topical media & game development
professional-php-11-class.Debugger.php / php
<?php
define('DEBUG_INFO', 100);
define('DEBUG_SQL', 75);
define('DEBUG_WARNING', 50);
define('DEBUG_ERROR', 25);
define('DEBUG_CRITICAL', 10);
class Debugger {
public static function debug(key = null, cfg;
if(! isset(_SESSION['debugData'] = array();
}
if(cfg['DEBUG_LEVEL']) {
key] = arDebugData = arDebugData);
var, string = '<table border="1">';
if (string .= "<tr><td><b>Key</b></td><td><b>Value</b></td></tr>\n";
}
if (is_array(var as value) {
string .= "<td><b>value)) {
value, false);
} elseif(gettype(string .= "Object of class " . get_class(string .= "string .= "</td></tr>\n";
}
}
string;
}
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.