1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

Add possibility to pass handlers/processors to Logger::__construct, fixes #157

This commit is contained in:
Jordi Boggiano
2013-02-13 19:06:07 +01:00
parent 237a147b9c
commit 9f515d47ce
2 changed files with 36 additions and 5 deletions

View File

@@ -99,16 +99,27 @@ class Logger implements LoggerInterface
*
* @var array of Monolog\Handler\HandlerInterface
*/
protected $handlers = array();
protected $processors = array();
protected $handlers;
/**
* @param string $name The logging channel
* Processors that will process all log records
*
* To process records of a single handler instead, add the processor on that specific handler
*
* @var array of callables
*/
public function __construct($name)
protected $processors;
/**
* @param string $name The logging channel
* @param array $handlers Optional stack of handlers, the first one in the array is called first, etc.
* @param array $processors Optional array of processors
*/
public function __construct($name, array $handlers = array(), array $processors = array())
{
$this->name = $name;
$this->handlers = $handlers;
$this->processors = $processors;
}
/**