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:
authordiosmosis <benakamoorthi@fastmail.fm>2014-08-30 13:02:04 +0400
committerdiosmosis <benakamoorthi@fastmail.fm>2014-08-30 13:02:04 +0400
commit6858713386578aebdf354208eb97eb7f61ae1beb (patch)
tree463aefe03e95379539920d989a7de75459cbd3cc /core/Log.php
parent48c8193f770186029ad0120a011fb517364d8e80 (diff)
Make sure arrays are formatted correctly in Log calls w/ sprintf params and indent message newlines so they can be more easily parsed.
Diffstat (limited to 'core/Log.php')
-rw-r--r--core/Log.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/Log.php b/core/Log.php
index 4e505f7b63..54b96a8302 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -418,6 +418,13 @@ class Log extends Singleton
if (is_string($message)
&& !empty($sprintfParams)
) {
+ // handle array sprintf parameters
+ foreach ($sprintfParams as &$param) {
+ if (is_array($param)) {
+ $param = json_encode($param);
+ }
+ }
+
$message = vsprintf($message, $sprintfParams);
}
@@ -676,6 +683,8 @@ class Log extends Singleton
*/
Piwik::postEvent(self::FORMAT_FILE_MESSAGE_EVENT, array(&$message, $level, $tag, $datetime, $logger));
}
+
+ $message = str_replace("\n", "\n ", $message);
return $message . "\n";
}
}