]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
move filename stuff to debug function
authorEvan Prodromou <evan@prodromou.name>
Thu, 5 Jun 2008 02:47:17 +0000 (22:47 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 5 Jun 2008 02:47:17 +0000 (22:47 -0400)
darcs-hash:20080605024717-84dde-dc897a855af13ea30bb670daf94749e9f14fa7ad.gz

lib/common.php
lib/util.php

index b2c0a7b4645abd72415303735aaa2bfd34f2a22a..f910b361350cd764d125458fd4c3e691ec31bec2 100644 (file)
@@ -35,10 +35,12 @@ require_once('DB/DataObject/Cast.php'); # for dates
 $config =
   array('site' =>
                array('name' => 'Just another Laconica microblog',
-                         'appname' => 'laconica', # for syslog
                          'server' => 'localhost',
                          'path' => '/',
                          'fancy' => false),
+               'syslog' =>
+               array('appname' => 'laconica', # for syslog
+                         'priority' => 'debug'), # XXX: currently ignored
                'tag' =>
                array('authority' => 'INVALID TAG',
                          'date' => 'PUT A DATE HERE',
index 7171211da3dfa3983c21b9c1ed9ec2a6e53f44cd..03b1e42a90ed2fea685c6533a0302bb5461f92c1 100644 (file)
@@ -577,20 +577,22 @@ function common_ensure_syslog() {
        if (!$initialized) {
                global $config;
                define_syslog_variables();
-               openlog($config['site']['appname'], 0, LOG_USER);
+               openlog($config['syslog']['appname'], 0, LOG_USER);
                $initialized = true;
        }
 }
 
 function common_log($priority, $msg, $filename=NULL) {
        common_ensure_syslog();
-       if ($filename) {
-               syslog($priority, basename($filename).' - '.$msg);
-       }
+       syslog($priority, $msg);
 }
 
 function common_debug($msg, $filename=NULL) {
-       common_log(LOG_DEBUG, $msg, $filename);
+       if ($filename) {
+               common_log(LOG_DEBUG, basename($filename).' - '.$msg);
+       } else {
+               common_log(LOG_DEBUG, $msg);
+       }
 }
 
 function common_valid_http_url($url) {