summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-30 14:22:30 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-30 14:22:30 -0400
commita73a63758f2ab9b4d951bb428b774f072b28817a (patch)
tree50f4cf9d3ff24964645542d7c2349bc639549f4b /lib
parentd3dd804ddf55e7aba9533a180a5d9c98392b03df (diff)
add debug logging and do some from the remotesubscribe page
darcs-hash:20080530182230-84dde-b9b6f515affcd245abb5e199de02a8891138ff2a.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 126801126..d9171c743 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -553,3 +553,21 @@ function common_timestamp() {
function _t($str) {
return $str;
}
+
+function common_ensure_syslog() {
+ static $initialized = false;
+ if (!$initialized) {
+ define_syslog_variables();
+ openlog("laconica", LOG_PID, LOG_USER);
+ $initialized = true;
+ }
+}
+
+function common_log($priority, $msg) {
+ common_ensure_syslog();
+ syslog($priority, $msg);
+}
+
+function common_debug($msg) {
+ common_log(LOG_DEBUG, $msg);
+} \ No newline at end of file