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-09-01 05:18:11 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-09-01 20:12:43 +0400
commit0ad65ad9e988dd18b7afcc11f041376d4cf963d2 (patch)
tree714005c3b6ab3c80efca681ce2335e6d8e274d86 /core/Log.php
parent5578a54985282e6da3e3cc2c1b2d1532c91fabd7 (diff)
Make sure log messages are trimmed correctly for clean log output.
Diffstat (limited to 'core/Log.php')
-rw-r--r--core/Log.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Log.php b/core/Log.php
index 54b96a8302..a860dd1989 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -256,7 +256,7 @@ class Log extends Singleton
{
return str_replace(
array("%tag%", "%message%", "%datetime%", "%level%"),
- array($tag, $message, $datetime, $this->getStringLevel($level)),
+ array($tag, trim($message), $datetime, $this->getStringLevel($level)),
$this->logMessageFormat
);
}
@@ -590,6 +590,7 @@ class Log extends Singleton
*/
Piwik::postEvent(self::FORMAT_SCREEN_MESSAGE_EVENT, array(&$message, $level, $tag, $datetime, $logger));
}
+ $message = trim($message);
return $message . "\n";
}
@@ -643,6 +644,7 @@ class Log extends Singleton
*/
Piwik::postEvent(self::FORMAT_DATABASE_MESSAGE_EVENT, array(&$message, $level, $tag, $datetime, $logger));
}
+ $message = trim($message);
return $message;
}
@@ -684,6 +686,7 @@ class Log extends Singleton
Piwik::postEvent(self::FORMAT_FILE_MESSAGE_EVENT, array(&$message, $level, $tag, $datetime, $logger));
}
+ $message = trim($message);
$message = str_replace("\n", "\n ", $message);
return $message . "\n";
}