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:
authorThomas Steur <thomas.steur@googlemail.com>2014-03-25 02:06:02 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-03-25 02:06:02 +0400
commitdbe8a799d7e7fc8417b13ac8838f963d6187a5dc (patch)
tree211a000d9af9ddff863a851a1e89fcbe74d32187 /core/Common.php
parent0ab1d1040899ddf03ba5386a78523e7d2c780442 (diff)
refs #4780 added possibility to enable tracker debug via config, use logger for printing debug messages which allows users to log to screen, file or db
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/Common.php b/core/Common.php
index b25047f078..ec31f88280 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -31,7 +31,6 @@ class Common
public static $isCliMode = null;
-
/*
* Database
*/
@@ -1062,17 +1061,19 @@ class Common
static public function printDebug($info = '')
{
if (isset($GLOBALS['PIWIK_TRACKER_DEBUG']) && $GLOBALS['PIWIK_TRACKER_DEBUG']) {
- if(is_object($info)) {
+
+ if (is_object($info)) {
$info = var_export($info, true);
}
+
+ Log::getInstance()->setLogLevel(Log::DEBUG);
+
if (is_array($info)) {
- print("<pre>");
$info = Common::sanitizeInputValues($info);
$out = var_export($info, true);
- echo $out;
- print("</pre>");
+ Log::debug($out);
} else {
- print(htmlspecialchars($info, ENT_QUOTES) . "<br />\n");
+ Log::debug(htmlspecialchars($info, ENT_QUOTES));
}
}
}