Logger Abstract Class. More...
Public Member Functions | |
__construct ($mask=false) | |
Constructor. | |
setNext (axLogger $logger) | |
Set next logger in chain and return the attached logger. | |
message ($msg, $priority=self::NOTICE) | |
Send a message through the chain. | |
writeMessage ($msg, $severity) | |
Write the message . | |
Data Fields | |
const | ERR = 1 |
const | NOTICE = 2 |
const | WARNING = 4 |
const | DEBUG = 8 |
Protected Attributes | |
$_mask | |
$_next |
Logger Abstract Class.
This class is the base implementation for any logger class. When extending this class, you just have to implement the writeMessage
method and optionaly to override the constructor to build your own custom loggers. Logger are designed in a way they will always forward the message to the next logger (see axLogger::setNext()) after writing it (if the priority match its mask).
Definition at line 21 of file axLogger.class.php.
axLogger::__construct | ( | $ | mask = false | ) |
Constructor.
integer | $mask | The mask of priorities to match (or false to match all priorities) |
Definition at line 48 of file axLogger.class.php.
axLogger::message | ( | $ | msg, |
$ | priority = self::NOTICE |
||
) |
Send a message through the chain.
Will write the message using the writeMessage method if the $priority
parameter match the mask (defined in constructor). In any case, will send the message and its priority to the next logger (if any). The the $priority
parameter doesn't match any of axLogger constant, then the axLogger::ERR will be used.
string | $msg | The message |
integer | $priority | [optional] [default axLogger::NOTICE ] The message's priority |
Definition at line 74 of file axLogger.class.php.
axLogger::setNext | ( | axLogger $ | logger | ) |
Set next logger in chain and return the attached logger.
axLogger | $logger | The logger to attach as next in the chain |
Definition at line 59 of file axLogger.class.php.
axLogger::writeMessage | ( | $ | msg, |
$ | severity | ||
) | [abstract] |
Write the message .
string | $msg | The message to write |
string | $severity | (one of 'Error','Notice','Warning', or 'Debug') |
Reimplemented in axTextLogger.
integer axLogger::$_mask [protected] |
axLogger's mask
Definition at line 36 of file axLogger.class.php.
axLogger::$_next [protected] |
Definition at line 42 of file axLogger.class.php.
const axLogger::DEBUG = 8 |
Definition at line 30 of file axLogger.class.php.
const axLogger::ERR = 1 |
Definition at line 27 of file axLogger.class.php.
const axLogger::NOTICE = 2 |
Definition at line 28 of file axLogger.class.php.
const axLogger::WARNING = 4 |
Definition at line 29 of file axLogger.class.php.