Improvements to debug_log

This commit is contained in:
Deon George
2009-08-19 13:39:37 +10:00
parent 0eaf3bb67b
commit 5669c92371
26 changed files with 1478 additions and 531 deletions

View File

@@ -28,8 +28,8 @@ class page {
protected $_default;
public function __construct($index=null) {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$index);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
# If we done have a configuration, then our IMGDIR and CSS are not defined
if (! defined('IMGDIR'))
@@ -69,7 +69,7 @@ class page {
header('Content-Encoding: gzip');
if (DEBUG_ENABLED)
debug_log('Sent COMPRESSED header to browser and discarded (%s)',129,__FILE__,__LINE__,__METHOD__,$preOutput);
debug_log('Sent COMPRESSED header to browser and discarded (%s)',129,0,__FILE__,__LINE__,__METHOD__,$preOutput);
}
if (isset($_SESSION[APPCONFIG])
@@ -91,13 +91,16 @@ class page {
/* Add to the HTML Header */
public function head_add($html) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
$this->_head[] .= $html;
}
/* Print out the HTML header */
private function pageheader_print() {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
# HTML prepage requirements.
foreach ($this->_pageheader as $line)
@@ -138,8 +141,8 @@ class page {
}
private function head_print() {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (isset($_SESSION[APPCONFIG]))
$pagetitle = $_SESSION[APPCONFIG]->getValue('appearance','page_title') ? ' - '.$_SESSION[APPCONFIG]->getValue('appearance','page_title') : '';
@@ -174,8 +177,8 @@ class page {
}
private function control_print() {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
echo '<table class="control" width=100% border=0>';
echo '<tr><td>';
@@ -202,8 +205,8 @@ class page {
}
protected function tree() {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (! isset($_SESSION[APPCONFIG]))
return;
@@ -231,6 +234,9 @@ class page {
}
public function block_add($side,$object) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (! is_object($object))
error(sprintf('block_add called with [%s], but it is not an object',serialize($object)));
@@ -238,8 +244,8 @@ class page {
}
private function block_print($side) {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (! isset($this->_block[$side]))
return;
@@ -251,8 +257,8 @@ class page {
}
private function sysmsg() {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (isset($this->sysmsg)) {
foreach ($this->sysmsg as $index => $details) {
@@ -289,8 +295,8 @@ class page {
}
private function body($raw=false) {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
# Add the Session System Messages
if (isset($_SESSION['sysmsg']) && is_array($_SESSION['sysmsg'])) {
@@ -313,8 +319,8 @@ class page {
}
private function footer_print() {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with ()',129,__FILE__,__LINE__,__METHOD__);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
printf('<tr class="foot"><td><small>%s</small></td><td colspan=2><div id="ajFOOT">%s</div>%s</td></tr>',
isCompress() ? '[C]' : '&nbsp;',
@@ -326,8 +332,8 @@ class page {
* Only show a particular page frame - used by an AJAX call
*/
public function show($frame,$compress=false,$raw=false) {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with (%s)',129,__FILE__,__LINE__,__METHOD__,$compress);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
# If the body is called via AJAX, and compression is enable, we need to compress the output
if ($compress && ob_get_level() && isCompress()) {
@@ -353,7 +359,7 @@ class page {
ob_end_clean();
if (DEBUG_ENABLED)
debug_log('Sending COMPRESSED output to browser[(%s),%s]',129,__FILE__,__LINE__,__METHOD__,
debug_log('Sending COMPRESSED output to browser[(%s),%s]',129,0,__FILE__,__LINE__,__METHOD__,
strlen($output),$output);
print gzencode($output);
@@ -361,8 +367,8 @@ class page {
}
public function display($filter=array()) {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$filter);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
# Control what is displayed.
$display = array(
@@ -431,7 +437,7 @@ class page {
ob_end_clean();
if (DEBUG_ENABLED)
debug_log('Sending COMPRESSED output to browser[(%s),%s]',129,__FILE__,__LINE__,__METHOD__,
debug_log('Sending COMPRESSED output to browser[(%s),%s]',129,0,__FILE__,__LINE__,__METHOD__,
strlen($output),$output);
print gzencode($output);
@@ -439,8 +445,8 @@ class page {
}
public function setsysmsg($data) {
if (defined('DEBUG_ENABLED') && DEBUG_ENABLED)
debug_log('Entered with [%s]',129,__FILE__,__LINE__,__METHOD__,$data);
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);
if (! is_array($data))
return;
@@ -467,9 +473,6 @@ class block {
private $body;
private $foot;
public function __construct() {
}
public function setTitle($html) {
$this->title = $html;
}