Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-03-26 04:03:13 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-03-26 04:09:49 +0300
commitac8e43b1fae6274647f1295345e63b351babf700 (patch)
treee2359394214550bc30d0802a8000f2cc618348e7 /core/Log.php
parent50edb1bc20e574f0b2ca374f9f40d218ac03d1c1 (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.php6
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);