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:
Diffstat (limited to 'core/Common.php')
-rw-r--r--core/Common.php34
1 files changed, 10 insertions, 24 deletions
diff --git a/core/Common.php b/core/Common.php
index 6a6fad5df4..15f709ce7a 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -1259,34 +1259,20 @@ class Common
}
/**
- * @todo This method is weird, it's debugging statements but seem to only work for the tracker, maybe it
- * should be moved elsewhere
+ * @deprecated Use the logger directly instead.
*/
public static function printDebug($info = '')
{
- if (isset($GLOBALS['PIWIK_TRACKER_DEBUG']) && $GLOBALS['PIWIK_TRACKER_DEBUG']) {
- if (!headers_sent()) {
- // prevent XSS in tracker debug output
- Common::sendHeader('Content-type: text/plain');
- }
-
- if (is_object($info)) {
- $info = var_export($info, true);
- }
-
- $logger = StaticContainer::get('Psr\Log\LoggerInterface');
+ if (is_object($info)) {
+ $info = var_export($info, true);
+ }
- if (is_array($info) || is_object($info)) {
- $info = Common::sanitizeInputValues($info);
- $out = var_export($info, true);
- foreach (explode("\n", $out) as $line) {
- $logger->debug($line);
- }
- } else {
- foreach (explode("\n", $info) as $line) {
- $logger->debug($line);
- }
- }
+ $logger = StaticContainer::get('Psr\Log\LoggerInterface');
+ if (is_array($info) || is_object($info)) {
+ $out = var_export($info, true);
+ $logger->debug($out);
+ } else {
+ $logger->debug($info);
}
}