Axiom (v1.2.0)

A lightweight PHP framework
axLogger Class Reference

Logger Abstract Class. More...

+ Inheritance diagram for axLogger:

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

Detailed Description

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).

Author:
Delespierre
License:
http://www.gnu.org/licenses/lgpl.html Lesser General Public Licence version 3

Definition at line 21 of file axLogger.class.php.


Constructor & Destructor Documentation

axLogger::__construct ( mask = false)

Constructor.

Parameters:
integer$maskThe mask of priorities to match (or false to match all priorities)

Definition at line 48 of file axLogger.class.php.


Member Function Documentation

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.

Parameters:
string$msgThe message
integer$priority[optional] [default axLogger::NOTICE] The message's priority
Returns:
axLogger

Definition at line 74 of file axLogger.class.php.

axLogger::setNext ( axLogger logger)

Set next logger in chain and return the attached logger.

Parameters:
axLogger$loggerThe logger to attach as next in the chain
Returns:
axLogger

Definition at line 59 of file axLogger.class.php.

axLogger::writeMessage ( msg,
severity 
) [abstract]

Write the message .

Parameters:
string$msgThe message to write
string$severity(one of 'Error','Notice','Warning', or 'Debug')
Returns:
axLogger

Reimplemented in axTextLogger.


Field Documentation

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.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables