forked from GNUsocial/gnu-social
move filename stuff to debug function
darcs-hash:20080605024717-84dde-dc897a855af13ea30bb670daf94749e9f14fa7ad.gz
This commit is contained in:
parent
d241352dcc
commit
ea40a9cd93
@ -35,10 +35,12 @@ require_once('DB/DataObject/Cast.php'); # for dates
|
|||||||
$config =
|
$config =
|
||||||
array('site' =>
|
array('site' =>
|
||||||
array('name' => 'Just another Laconica microblog',
|
array('name' => 'Just another Laconica microblog',
|
||||||
'appname' => 'laconica', # for syslog
|
|
||||||
'server' => 'localhost',
|
'server' => 'localhost',
|
||||||
'path' => '/',
|
'path' => '/',
|
||||||
'fancy' => false),
|
'fancy' => false),
|
||||||
|
'syslog' =>
|
||||||
|
array('appname' => 'laconica', # for syslog
|
||||||
|
'priority' => 'debug'), # XXX: currently ignored
|
||||||
'tag' =>
|
'tag' =>
|
||||||
array('authority' => 'INVALID TAG',
|
array('authority' => 'INVALID TAG',
|
||||||
'date' => 'PUT A DATE HERE',
|
'date' => 'PUT A DATE HERE',
|
||||||
|
12
lib/util.php
12
lib/util.php
@ -577,20 +577,22 @@ function common_ensure_syslog() {
|
|||||||
if (!$initialized) {
|
if (!$initialized) {
|
||||||
global $config;
|
global $config;
|
||||||
define_syslog_variables();
|
define_syslog_variables();
|
||||||
openlog($config['site']['appname'], 0, LOG_USER);
|
openlog($config['syslog']['appname'], 0, LOG_USER);
|
||||||
$initialized = true;
|
$initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_log($priority, $msg, $filename=NULL) {
|
function common_log($priority, $msg, $filename=NULL) {
|
||||||
common_ensure_syslog();
|
common_ensure_syslog();
|
||||||
if ($filename) {
|
syslog($priority, $msg);
|
||||||
syslog($priority, basename($filename).' - '.$msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function common_debug($msg, $filename=NULL) {
|
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) {
|
function common_valid_http_url($url) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user