mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 11:55:57 +00:00
update.php: add support for output logging
This commit is contained in:
@@ -122,14 +122,24 @@
|
||||
* @return void
|
||||
*/
|
||||
function _debug($msg) {
|
||||
if (defined('QUIET') && QUIET) {
|
||||
return;
|
||||
}
|
||||
$ts = strftime("%H:%M:%S", time());
|
||||
if (function_exists('posix_getpid')) {
|
||||
$ts = "$ts/" . posix_getpid();
|
||||
}
|
||||
print "[$ts] $msg\n";
|
||||
|
||||
if (!(defined('QUIET') && QUIET)) {
|
||||
print "[$ts] $msg\n";
|
||||
}
|
||||
|
||||
if (defined('LOGFILE')) {
|
||||
$fp = fopen(LOGFILE, 'a+');
|
||||
|
||||
if ($fp) {
|
||||
fputs($fp, "[$ts] $msg\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
} // function _debug
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user