mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-24 06:52:34 +01:00
getLevelName needs to be called earlier, so it can still thrown
exceptions for invalid levels even without a handler
This commit is contained in:
parent
38f8dc52de
commit
ae68665460
@ -229,6 +229,8 @@ class Logger implements LoggerInterface
|
||||
$this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
|
||||
}
|
||||
|
||||
$levelName = static::getLevelName($level);
|
||||
|
||||
// check if any handler will handle this message
|
||||
$handlerKey = null;
|
||||
foreach ($this->handlers as $key => $handler) {
|
||||
@ -250,7 +252,7 @@ class Logger implements LoggerInterface
|
||||
'message' => (string) $message,
|
||||
'context' => $context,
|
||||
'level' => $level,
|
||||
'level_name' => static::getLevelName($level),
|
||||
'level_name' => $levelName,
|
||||
'channel' => $this->name,
|
||||
'datetime' => \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone)->setTimezone(static::$timezone),
|
||||
'extra' => array(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user