1
0
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:
Andrew Dolgov
2013-03-21 14:56:04 +04:00
parent 764555ff8a
commit 2191eb7aab
2 changed files with 21 additions and 5 deletions

View File

@@ -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
/**