mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-21 16:46:11 +02:00
Tweak patch a bit, refs #617
This commit is contained in:
@@ -176,19 +176,18 @@ class Logger implements LoggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Set handlers, removing all existing ones.
|
||||
* Falsey values will be ignored, and if a map is passed, keys will be ignored.
|
||||
* Set handlers, replacing all existing ones.
|
||||
*
|
||||
* @param array $handlers All elements must be of type HandlerInterface
|
||||
* If a map is passed, keys will be ignored.
|
||||
*
|
||||
* @param HandlerInterface[] $handlers
|
||||
* @return $this
|
||||
*/
|
||||
public function setHandlers(array $handlers)
|
||||
{
|
||||
$this->handlers = array();
|
||||
foreach ($handlers as $handler) {
|
||||
if ($handler) {
|
||||
$this->pushHandler($handler);
|
||||
}
|
||||
foreach (array_reverse($handlers) as $handler) {
|
||||
$this->pushHandler($handler);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user