1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-23 22:42:38 +01:00

Partially prevent circular references in the handler chain

This commit is contained in:
Jordi Boggiano 2011-02-24 22:14:00 +01:00
parent f4e85e9412
commit 1983270611

View File

@ -72,6 +72,9 @@ class Logger
public function pushHandler(HandlerInterface $handler)
{
if ($this->handler) {
if ($this->handler === $handler) {
throw new \UnexpectedValueException('Circular reference, do not add the same handler instance twice.');
}
$handler->setParent($this->handler);
}
$this->handler = $handler;