diff options
author | Andrew Dolgov <[email protected]> | 2013-04-19 13:24:51 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-19 13:26:10 +0400 |
commit | 9ec103525da078d46fc2cf0a5ed34a690385120c (patch) | |
tree | 893c7384a9e6db2688998f42da149b254059dcd3 /include/functions.php | |
parent | ebec81a6fb2dff0b2fe6b569b021e057995ee6c7 (diff) |
update_rss_feed: simplify debug reporting
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index 8ac5753c9..004f4db2f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -129,6 +129,9 @@ $utc_tz = new DateTimeZone('UTC'); $schema_version = false; + global $_debug_enabled; + $_debug_enabled = true; + /** * Print a timestamped debug message. * @@ -136,6 +139,10 @@ * @return void */ function _debug($msg) { + global $_debug_enabled; + + if (!$_debug_enabled) return; + $ts = strftime("%H:%M:%S", time()); if (function_exists('posix_getpid')) { $ts = "$ts/" . posix_getpid(); @@ -156,6 +163,15 @@ } // function _debug + function _debug_enable($enabled) { + global $_debug_enabled; + + $old = $_debug_enabled; + $_debug_enabled = $enabled; + + return $old; + } + /** * Purge a feed old posts. * |