From cfc819bc4aa48c39ddbf86befe4c910d3a8932d9 Mon Sep 17 00:00:00 2001 From: Thomas Steur <thomas.steur@googlemail.com> Date: Mon, 31 Mar 2014 05:15:21 +0200 Subject: [PATCH] trying to log only to screen in this web test --- core/CronArchive.php | 5 ++++- tests/PHPUnit/Integration/ArchiveWebTest.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/CronArchive.php b/core/CronArchive.php index 9158983d7b..f3c6fc8a17 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -695,7 +695,10 @@ class CronArchive $log = $config->log; $log['log_only_when_debug_parameter'] = 0; $log[\Piwik\Log::LOG_WRITERS_CONFIG_OPTION] = array("screen"); - Log::getInstance()->addLogWriter('screen'); + + if (!empty($_GET['forcelogtoscreen'])) { + Log::getInstance()->addLogWriter('screen'); + } // Make sure we log at least INFO (if logger is set to DEBUG then keep it) $logLevel = @$log[\Piwik\Log::LOG_LEVEL_CONFIG_OPTION]; diff --git a/tests/PHPUnit/Integration/ArchiveWebTest.php b/tests/PHPUnit/Integration/ArchiveWebTest.php index ba84534cb2..6598f11df8 100644 --- a/tests/PHPUnit/Integration/ArchiveWebTest.php +++ b/tests/PHPUnit/Integration/ArchiveWebTest.php @@ -36,7 +36,7 @@ class Test_Piwik_Integration_ArchiveWebTest extends IntegrationTestCase $urlTmp = Option::get('piwikUrl'); Option::set('piwikUrl', $host . 'tests/PHPUnit/proxy/index.php'); - $output = file_get_contents($host . 'tests/PHPUnit/proxy/archive.php?token_auth=' . $token); + $output = file_get_contents($host . 'tests/PHPUnit/proxy/archive.php?token_auth=' . $token . '&forcelogtoscreen=1'); if (!empty($urlTmp)) { Option::set('piwikUrl', $urlTmp); -- GitLab