diff options
Diffstat (limited to 'core/Log.php')
-rw-r--r-- | core/Log.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/core/Log.php b/core/Log.php index f759b351d7..7ca7721f5e 100644 --- a/core/Log.php +++ b/core/Log.php @@ -8,6 +8,7 @@ namespace Piwik; +use Monolog\Logger; use Piwik\Container\StaticContainer; use Piwik\Db; @@ -255,7 +256,7 @@ class Log extends Singleton 'message' => $message, 'context' => $parameters, 'channel' => 'piwik', - 'level' => $level, + 'level' => $this->getMonologLevel($level), 'level_name' => self::getStringLevel($level), 'time' => new \DateTime(), 'extra' => array(), @@ -336,4 +337,24 @@ class Log extends Singleton ); return $levelToName[$level]; } + + private function getMonologLevel($level) + { + switch ($level) { + case self::ERROR: + return Logger::ERROR; + case self::WARN: + return Logger::WARNING; + case self::INFO: + return Logger::INFO; + case self::DEBUG: + return Logger::DEBUG; + case self::VERBOSE: + return Logger::DEBUG; + case self::NONE: + default: + // Highest level possible, need to do better in the future... + return Logger::EMERGENCY; + } + } } |