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

Removed Logger::toMonologLevel() code duplication and added relevant tests

This commit is contained in:
Reda Bouchaala
2015-04-25 19:42:19 +01:00
parent d84ba2cb20
commit 2cb4a57490
2 changed files with 17 additions and 4 deletions

View File

@@ -438,10 +438,8 @@ class Logger implements LoggerInterface
*/
public function log($level, $message, array $context = array())
{
if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
$level = constant(__CLASS__.'::'.strtoupper($level));
}
$level = static::toMonologLevel($level);
return $this->addRecord($level, $message, $context);
}