From ac8e43b1fae6274647f1295345e63b351babf700 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Thu, 26 Mar 2015 14:03:13 +1300 Subject: #7535 Log warning but do not throw if trying to log a non-string message --- core/Log.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/Log.php') diff --git a/core/Log.php b/core/Log.php index 260e57fea6..82f2beab66 100644 --- a/core/Log.php +++ b/core/Log.php @@ -209,8 +209,12 @@ class Log extends Singleton $parameters['exception'] = $message; $message = $message->getMessage(); } + if (! is_string($message)) { - throw new \InvalidArgumentException('Trying to log a message that is not a string'); + $this->logger->warning('Trying to log a message that is not a string', array( + 'exception' => new \InvalidArgumentException + )); + return; } $this->logger->log($level, $message, $parameters); -- cgit v1.2.3