diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-01 05:43:03 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-12-01 05:51:37 +0300 |
commit | 0794be0d5551998b683ac934e00604d277fe69e9 (patch) | |
tree | 26a43fbc68f219fc6116ceebfed132ad1c9107dd /core/Log/Formatter/ErrorHtmlFormatter.php | |
parent | f1fae09be4507bd9dedfc949deab98108b47b23e (diff) |
#6622 Logger refactoring: use a "record" array similar to Monolog to ease future transition
Diffstat (limited to 'core/Log/Formatter/ErrorHtmlFormatter.php')
-rw-r--r-- | core/Log/Formatter/ErrorHtmlFormatter.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/Log/Formatter/ErrorHtmlFormatter.php b/core/Log/Formatter/ErrorHtmlFormatter.php index 210af8b71f..f499df9b10 100644 --- a/core/Log/Formatter/ErrorHtmlFormatter.php +++ b/core/Log/Formatter/ErrorHtmlFormatter.php @@ -18,10 +18,12 @@ use Piwik\Version; */ class ErrorHtmlFormatter extends Formatter { - public function format($message, $level, $tag, $datetime, Log $logger) + public function format(array $record, Log $logger) { + $message = $record['message']; + if (! $message instanceof Error) { - return $this->next($message, $level, $tag, $datetime, $logger); + return $this->next($record, $logger); } $errno = $message->errno & error_reporting(); @@ -50,6 +52,8 @@ class ErrorHtmlFormatter extends Formatter $html .= "</div><br />"; $html .= "\n </pre></div><br />"; - return $html; + $record['message'] = $html; + + return $record; } } |