| 1 |
<? |
<? |
| 2 |
// --------------------------------------------------------------------------- |
/** |
| 3 |
// $Id$ |
* This file contains the Class::Logger class. |
| 4 |
// --------------------------------------------------------------------------- |
* |
| 5 |
// $Log$ |
* @author Andreas Motl <andreas.motl@ilo.de> |
| 6 |
// Revision 1.1 2003/03/03 21:26:43 joko |
* @package org.netfrag.glib |
| 7 |
// refactored from DesignPattern::Logger |
* @name Class::Logger |
| 8 |
// |
* |
| 9 |
// Revision 1.4 2003/02/13 00:43:41 joko |
*/ |
| 10 |
// + logfile name now can get passed via defined constant |
|
| 11 |
// |
|
| 12 |
// Revision 1.3 2003/02/09 17:14:49 joko |
/** |
| 13 |
// + now able to redirect errors raised by PEAR to logfile |
* <b>Cvs-Log:</b> |
| 14 |
// |
* |
| 15 |
// Revision 1.2 2003/02/03 14:47:49 joko |
* <pre> |
| 16 |
// + some code from DesignPattern::Bridge |
* |
| 17 |
// |
* $Id$ |
| 18 |
// Revision 1.1 2003/02/03 03:33:48 joko |
* |
| 19 |
// + initial commit |
* $Log$ |
| 20 |
// |
* Revision 1.9 2003/03/27 15:59:55 joko |
| 21 |
// --------------------------------------------------------------------------- |
* enhanced 'function log' |
| 22 |
|
* |
| 23 |
|
* Revision 1.8 2003/03/11 02:23:02 joko |
| 24 |
|
* + fixed metadata for phpDocumentor |
| 25 |
|
* |
| 26 |
|
* Revision 1.7 2003/03/11 02:14:23 joko |
| 27 |
|
* + fixed metadata for phpDocumentor |
| 28 |
|
* |
| 29 |
|
* Revision 1.6 2003/03/11 02:04:36 joko |
| 30 |
|
* + fixed metadata for phpDocumentor |
| 31 |
|
* |
| 32 |
|
* Revision 1.5 2003/03/11 01:42:59 joko |
| 33 |
|
* + fixed metadata for phpDocumentor |
| 34 |
|
* |
| 35 |
|
* Revision 1.4 2003/03/11 01:22:24 joko |
| 36 |
|
* + fixed metadata for phpDocumentor |
| 37 |
|
* |
| 38 |
|
* Revision 1.3 2003/03/11 01:12:53 joko |
| 39 |
|
* + fixed metadata for phpDocumentor |
| 40 |
|
* |
| 41 |
|
* Revision 1.2 2003/03/05 18:54:43 joko |
| 42 |
|
* updated docu - phpDocumentor is very strict about its 'blocks'... |
| 43 |
|
* |
| 44 |
|
* Revision 1.1 2003/03/03 21:26:43 joko |
| 45 |
|
* refactored from DesignPattern::Logger |
| 46 |
|
* |
| 47 |
|
* Revision 1.4 2003/02/13 00:43:41 joko |
| 48 |
|
* + logfile name now can get passed via defined constant |
| 49 |
|
* |
| 50 |
|
* Revision 1.3 2003/02/09 17:14:49 joko |
| 51 |
|
* + now able to redirect errors raised by PEAR to logfile |
| 52 |
|
* |
| 53 |
|
* Revision 1.2 2003/02/03 14:47:49 joko |
| 54 |
|
* + some code from DesignPattern::Bridge |
| 55 |
|
* |
| 56 |
|
* Revision 1.1 2003/02/03 03:33:48 joko |
| 57 |
|
* + initial commit |
| 58 |
|
* |
| 59 |
|
* </pre> |
| 60 |
|
* |
| 61 |
|
*/ |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
/** |
| 65 |
|
* This requires Class::Abstract as a base class |
| 66 |
|
* |
| 67 |
|
*/ |
| 68 |
|
php::loadModule('Class::Abstract'); |
| 69 |
|
|
| 70 |
|
|
| 71 |
php::loadModule('Class::Abstract'); |
/** |
| 72 |
|
* --- Class::Inner |
| 73 |
|
* |
| 74 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 75 |
|
* @copyright (c) 2003 - All Rights reserved. |
| 76 |
|
* @license GNU LGPL (GNU Lesser General Public License) |
| 77 |
|
* |
| 78 |
|
* @link http://www.netfrag.org/~joko/ |
| 79 |
|
* @link http://www.gnu.org/licenses/lgpl.txt |
| 80 |
|
* |
| 81 |
|
* @package org.netfrag.glib |
| 82 |
|
* @subpackage Class |
| 83 |
|
* @name Class::Logger |
| 84 |
|
* |
| 85 |
|
* |
| 86 |
|
*/ |
| 87 |
class Class_Logger extends Class_Abstract { |
class Class_Logger extends Class_Abstract { |
| 88 |
|
|
| 89 |
var $logger; |
var $logger; |
| 113 |
// TODO: how are these type of errors handled? |
// TODO: how are these type of errors handled? |
| 114 |
//print "error-message: $msg<br>"; |
//print "error-message: $msg<br>"; |
| 115 |
} |
} |
| 116 |
|
|
| 117 |
|
//$precon = 1; |
| 118 |
|
$precon = $this->DEBUG; |
| 119 |
|
if ($precon && $level && $level <= PEAR_LOG_WARNING) { |
| 120 |
|
//user_error($msg); |
| 121 |
|
print "<b>Error[$level]</b>: $msg<br/>"; |
| 122 |
|
} |
| 123 |
|
|
| 124 |
} |
} |
| 125 |
|
|
| 126 |
function _init_logger($logfile, $enable = 0) { |
function _init_logger($logfile, $enable = 0) { |