PHP Class Crunz\Logger\Logger

Inheritance: extends Crunz\Singleton, use trait Crunz\Configuration\Configurable
Mostra file Open project: lavary/crunz Class Usage Examples

Protected Properties

Property Type Description
$levels array The Log levels.
$logger Psr\Log\LoggerInterface Instance of Psr\Log\LoggerInterface

Public Methods

Method Description
__construct ( Logger $logger ) Initialize the logger instance
addStream ( string $path, integer $level, boolean $bubble = true ) : Monolog\Handler\StreamHandler Create a neaw stream handler
error ( string $message ) : boolean Log the error is error logging is enabled.
info ( string $content ) : boolean Log any output if output logging is enabled
write ( string $content, string $level ) : mixed Write the log to the specified stream

Protected Methods

Method Description
getDefaultFormatter ( ) : Monolog\Formatter\LineFormatter Get a default Monolog formatter instance
parseLevel ( string $level ) : integer Parse the string level into a Monolog constant.

Method Details

__construct() public method

Initialize the logger instance
public __construct ( Logger $logger )
$logger Monolog\Logger

addStream() public method

Create a neaw stream handler
public addStream ( string $path, integer $level, boolean $bubble = true ) : Monolog\Handler\StreamHandler
$path string
$level integer
$bubble boolean
return Monolog\Handler\StreamHandler

error() public method

Log the error is error logging is enabled.
public error ( string $message ) : boolean
$message string
return boolean

getDefaultFormatter() protected method

Get a default Monolog formatter instance
protected getDefaultFormatter ( ) : Monolog\Formatter\LineFormatter
return Monolog\Formatter\LineFormatter

info() public method

Log any output if output logging is enabled
public info ( string $content ) : boolean
$content string
return boolean

parseLevel() protected method

Parse the string level into a Monolog constant.
protected parseLevel ( string $level ) : integer
$level string
return integer

write() public method

Write the log to the specified stream
public write ( string $content, string $level ) : mixed
$content string
$level string
return mixed

Property Details

$levels protected_oe property

The Log levels.
protected array $levels
return array

$logger protected_oe property

Instance of Psr\Log\LoggerInterface
protected Psr\Log\LoggerInterface $logger
return Psr\Log\LoggerInterface