diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-23 17:27:27 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2009-12-23 17:27:27 -0500 |
commit | b46318283ca6016f07e3e419f778dd69081ad660 (patch) | |
tree | f2f19b2bf158ca4232a87989fde5d54707866f98 /includes/debug.php | |
parent | ebda82d787b3620424c1dcf4336146ea06815a55 (diff) | |
download | bayonetcms-b46318283ca6016f07e3e419f778dd69081ad660.tar.gz |
More debugging related code has been added.
Modules and block now report when they have loaded.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@396 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'includes/debug.php')
-rw-r--r-- | includes/debug.php | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/includes/debug.php b/includes/debug.php index 872f5db..516573d 100644 --- a/includes/debug.php +++ b/includes/debug.php @@ -25,26 +25,17 @@ define('REPEAT',true); static $last_message = NULL; static $last_message_count = 0; -static $debug_ident = NULL; static $log_message_last = NULL; static $log_message_queue = array(); static $log_message_pos = 0; -function debug_set_ident($str) -{ - global $debug_ident; - $debug_ident = $str; -} - -function debug_clear_ident() -{ - global $debug_ident; - $debug_ident = ""; -} - function decho($message, $from = "GENERIC") { - global $debug_ident, $log_message_last, $log_message_queue, $log_message_pos, $config; + global $log_message_last, $log_message_queue, $log_message_pos, $config; + + if($config['debug']['enabled'] == false || + $config['debug']['show_messages'] == false) return; + date_default_timezone_set($config['logs']['timezone']); $timestamp = date('H:i:s T'); $message = "[$timestamp]: $message"; @@ -55,6 +46,11 @@ function decho($message, $from = "GENERIC") function queuePrint($obj) { + global $config; + + if($config['debug']['enabled'] == false || + $config['debug']['show_messages'] == false) return; + if(is_array($obj)) { $array_dump = print_r($obj,true); |