From 102d5239a9a60e70edf868ea13222d749056a6e9 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Tue, 4 Feb 2014 00:51:38 +0100 Subject: [PATCH] Added a specific handling for a proper outpur of Exceptions in the log. --- core/lib/Thelia/Log/Tlog.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 5e3d0537a..7e3554755 100644 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -663,9 +663,13 @@ class Tlog Implements LoggerInterface { $text = ''; - if (is_scalar($message) === false) { - $text = print_r($message, true); - } else { + if ($message instanceof \Exception) { + $text = $message->getMessage()."\n".$message->getTraceAsString(); + } + else if (is_scalar($message) === false) { + $text = print_r($message, 1); + } + else { $text = $message; }