| 17 |
* $Id$ |
* $Id$ |
| 18 |
* |
* |
| 19 |
* $Log$ |
* $Log$ |
| 20 |
|
* Revision 1.11 2003/03/28 06:44:20 joko |
| 21 |
|
* VERBOSE mode |
| 22 |
|
* |
| 23 |
* Revision 1.10 2003/03/28 03:04:26 joko |
* Revision 1.10 2003/03/28 03:04:26 joko |
| 24 |
* enhanced conditions for debugging |
* enhanced conditions for debugging |
| 25 |
* |
* |
| 109 |
$this->_init_logger($logfile, 1); |
$this->_init_logger($logfile, 1); |
| 110 |
} |
} |
| 111 |
|
|
| 112 |
|
|
| 113 |
// TODO: split by loglevel here to make seperated logfiles possible (debug, normal, errors) |
// TODO: split by loglevel here to make seperated logfiles possible (debug, normal, errors) |
| 114 |
// TODO: optional: transmit logging messages via tcp - don't write them to disk (a handler for PEAR::Log) |
// TODO: optional: transmit logging messages via tcp - don't write them to disk (a handler for PEAR::Log) |
| 115 |
function log($msg, $level = PEAR_LOG_DEBUG) { |
function log($msg, $level = PEAR_LOG_DEBUG) { |
| 131 |
if ($debug_condition) { $label = 'Debug'; $color = 'darkgreen'; } |
if ($debug_condition) { $label = 'Debug'; $color = 'darkgreen'; } |
| 132 |
if ($error_condition) { $label = 'Error'; $color = 'red'; } |
if ($error_condition) { $label = 'Error'; $color = 'red'; } |
| 133 |
|
|
| 134 |
$stdout_condition = $level && ($debug_condition || $error_condition); |
$stdout_condition = constants::get('VERBOSE') && $level && ($debug_condition || $error_condition); |
| 135 |
if ($stdout_condition) { |
if ($stdout_condition) { |
| 136 |
// TODO: what now? |
// TODO: what now? |
| 137 |
//user_error($msg); |
//user_error($msg); |
| 138 |
//print "<div><span style=\"color: $color;\"><b>$label</b></span>[$level]: <i>$msg</i></div>"; |
//print "<div><span style=\"color: $color;\"><b>$label</b></span>[$level]: <i>$msg</i></div>"; |
| 139 |
print "<div><span style=\"color: $color;\"><b>$label</b></span>[$level]: $msg</div>"; |
$style = html_style("text/css", '.boxlabel_red { color: red; font-weight:bold; }'); |
| 140 |
|
$box = html_span(); |
| 141 |
|
//$box->set_style("border-bottom: 1px solid black;"); |
| 142 |
|
$box->add( html_span('boxlabel_red', $label), "[$level]: $msg", html_br() ); |
| 143 |
|
print $style->render(); |
| 144 |
|
print $box->render(); |
| 145 |
} |
} |
| 146 |
|
|
| 147 |
} |
} |