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_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);
}
}
}
}