diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-26 04:03:13 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-03-26 04:09:49 +0300 |
commit | ac8e43b1fae6274647f1295345e63b351babf700 (patch) | |
tree | e2359394214550bc30d0802a8000f2cc618348e7 /core/Log.php | |
parent | 50edb1bc20e574f0b2ca374f9f40d218ac03d1c1 (diff) |
#7535 Log warning but do not throw if trying to log a non-string message
Diffstat (limited to 'core/Log.php')
-rw-r--r-- | core/Log.php | 6 |
1 files changed, 5 insertions, 1 deletions
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); |