1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-04 20:27:31 +02:00

Move human readable level name resolution in Logger::addRecord() to as late as possible (#934)

This commit is contained in:
Ivan Kurnosov
2017-03-13 05:51:16 +13:00
committed by Jordi Boggiano
parent 7dd45ac6bf
commit f697ec7c96

View File

@@ -279,8 +279,6 @@ class Logger implements LoggerInterface
*/
public function addRecord(int $level, string $message, array $context = []): bool
{
$levelName = static::getLevelName($level);
// check if any handler will handle this message so we can return early and save cycles
$handlerKey = null;
reset($this->handlers);
@@ -297,6 +295,8 @@ class Logger implements LoggerInterface
return false;
}
$levelName = static::getLevelName($level);
$record = [
'message' => $message,
'context' => $context,