PHP Class Logger\Logger

Inheritance: extends Psr\Log\AbstractLogger, implements Psr\Log\LoggerInterface
Show file Open project: prggmr/xpspl Class Usage Examples

Protected Properties

Property Type Description
$_handlers Array of log handlers.
$_instance Instanceof the singleton
$_loggers Array of loggers.

Public Methods

Method Description
__clone ( ) Disallow cloning
add_global_handler ( Handler $handler ) : void Adds a global handler for all logs.
add_handler ( Handler $handler ) : void Adds a handler.
critical ( string $message ) : void Logs a critical message.
debug ( string $message ) : void Logs a debug message.
error ( string $message ) : void Logs a error message.
get_logger ( string $logger = null ) : object Returns a new logger.
info ( string $message ) : void Logs a info message.
instance ( ) Returns an instance of the singleton.
log ( integer $code, string $message ) : void Logs a message.
warning ( string $message ) : void Logs a warning message.

Method Details

__clone() final public method

Disallow cloning
final public __clone ( )

add_global_handler() public method

Adds a global handler for all logs.
public add_global_handler ( Handler $handler ) : void
$handler Handler HJandler
return void

add_handler() public method

Adds a handler.
public add_handler ( Handler $handler ) : void
$handler Handler HJandler
return void

critical() public method

Logs a critical message.
public critical ( string $message ) : void
$message string Message to log.
return void

debug() public method

Logs a debug message.
public debug ( string $message ) : void
$message string Message to log.
return void

error() public method

Logs a error message.
public error ( string $message ) : void
$message string Message to log.
return void

get_logger() public method

Returns a new logger.
public get_logger ( string $logger = null ) : object
$logger string Name of the logger.
return object Logger

info() public method

Logs a info message.
public info ( string $message ) : void
$message string Message to log.
return void

instance() final public static method

Passes args to constructor
final public static instance ( )

log() public method

Logs a message.
public log ( integer $code, string $message ) : void
$code integer Log level code.
$message string Message to log.
return void

warning() public method

Logs a warning message.
public warning ( string $message ) : void
$message string Message to log.
return void

Property Details

$_handlers protected property

Array of log handlers.
protected $_handlers

$_instance protected static property

Instanceof the singleton
protected static $_instance

$_loggers protected property

Array of loggers.
protected $_loggers