diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php index e8ee737bf006db95ce3dd298d098758895ccfe06..80356c17946d453e6e14d7b8967ebfb459864741 100644 --- a/core/Db/Schema/Mysql.php +++ b/core/Db/Schema/Mysql.php @@ -462,9 +462,6 @@ class Mysql implements SchemaInterface */ public function truncateAllTables() { - $message = 'truncateAllTables'; - \Piwik\Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - $tablesAlreadyInstalled = $this->getTablesInstalled($forceReload = true); foreach ($tablesAlreadyInstalled as $table) { Db::query("TRUNCATE `$table`"); diff --git a/core/Log.php b/core/Log.php index 7d9e501ddfa3a26c1761e6a01ca10d540e8c697e..5dc22d37c2d8ce6d92b13adb87548283074a1862 100644 --- a/core/Log.php +++ b/core/Log.php @@ -379,27 +379,6 @@ class Log extends Singleton return $this->currentLogLevel; } - public function customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, $addTrace = true) - { - if ($addTrace) { - $message = $message . "\n"; - $backTrace = debug_backtrace(); - $backTrace = array_slice($backTrace, 1, 2); - - foreach ($backTrace as &$trace) { - if (!empty($trace['object'])) { - unset($trace['object']); - } - } - $message .= var_export($backTrace, 1); - } - - if(!file_put_contents($this->logToFilePath, $message . "\n", FILE_APPEND)) { - $message = Filechecks::getErrorMessageMissingPermissions($this->logToFilePath); - throw new \Exception( $message ); - } - } - private function logToFile($level, $tag, $datetime, $message) { $message = $this->getMessageFormattedFile($level, $tag, $datetime, $message); diff --git a/plugins/PrivacyManager/IPAnonymizer.php b/plugins/PrivacyManager/IPAnonymizer.php index 34b176eedb600b2377dc33fd416f539101a024bc..de588c59fdb8dd94e9b65be668064a97aa8ad30a 100644 --- a/plugins/PrivacyManager/IPAnonymizer.php +++ b/plugins/PrivacyManager/IPAnonymizer.php @@ -10,7 +10,6 @@ namespace Piwik\Plugins\PrivacyManager; use Piwik\Common; use Piwik\IP; -use Piwik\Log; /** * Anonymize visitor IP addresses to comply with the privacy laws/guidelines in countries, such as Germany. @@ -54,9 +53,6 @@ class IPAnonymizer public function setVisitorIpAddress(&$ip) { if (!$this->isActive()) { - $message = "Visitor IP was _not_ anonymized: ". IP::N2P($ip); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - Common::printDebug("Visitor IP was _not_ anonymized: ". IP::N2P($ip)); return; } @@ -67,9 +63,6 @@ class IPAnonymizer $ip = self::applyIPMask($ip, $privacyConfig->ipAddressMaskLength); - $message = "Visitor IP (was: ". IP::N2P($originalIp) .") has been anonymized: ". IP::N2P($ip) . ' with length ' . $privacyConfig->ipAddressMaskLength; - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - Common::printDebug("Visitor IP (was: ". IP::N2P($originalIp) .") has been anonymized: ". IP::N2P($ip)); } diff --git a/plugins/UserCountry/Columns/Base.php b/plugins/UserCountry/Columns/Base.php index b9d14f23bd58f2d9c1d27c99e2f707c2e5cfe13b..35d96712173cf2ee895a9343989789e763529c1d 100644 --- a/plugins/UserCountry/Columns/Base.php +++ b/plugins/UserCountry/Columns/Base.php @@ -71,7 +71,7 @@ abstract class Base extends VisitDimension $key = md5(implode(',', $userInfo)); if (array_key_exists($key, self::$cachedLocations)) { - return self::$cachedLocations[$key]; + // return self::$cachedLocations[$key]; } $provider = $this->getProvider(); diff --git a/tests/PHPUnit/Fixture.php b/tests/PHPUnit/Fixture.php index 08bf6d79f7d6e856f901e246c3ae3daf8bd8ff66..e68ff787e95243109570008657365cd8a114dc40 100644 --- a/tests/PHPUnit/Fixture.php +++ b/tests/PHPUnit/Fixture.php @@ -115,8 +115,6 @@ class Fixture extends PHPUnit_Framework_Assert public function performSetUp($setupEnvironmentOnly = false) { - $message = 'Perform setup ' . get_class($this); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); try { if ($this->createConfig) { Config::getInstance()->setTestEnvironment(); @@ -258,10 +256,6 @@ class Fixture extends PHPUnit_Framework_Assert public function performTearDown() { - - $message = 'Perform teardown ' . get_class($this); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); - // Note: avoid run SQL in the *tearDown() metohds because it randomly fails on Travis CI // with error Error while sending QUERY packet. PID=XX $this->tearDown(); diff --git a/tests/PHPUnit/Fixtures/OmniFixture.php b/tests/PHPUnit/Fixtures/OmniFixture.php index 90a43c869b857ab1121f4461a66a61526e298654..0de39fd69f7b13d6281f8610deceb02e909d7504 100644 --- a/tests/PHPUnit/Fixtures/OmniFixture.php +++ b/tests/PHPUnit/Fixtures/OmniFixture.php @@ -8,7 +8,6 @@ namespace Piwik\Tests\Fixtures; use Piwik\Date; -use Piwik\Log; use ReflectionClass; /** @@ -86,8 +85,6 @@ class OmniFixture extends \Fixture public function setUp() { foreach ($this->fixtures as $fixture) { - $message = 'Setting up fixture ' . get_class($fixture); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); $fixture->setUp(); } } @@ -95,8 +92,6 @@ class OmniFixture extends \Fixture public function tearDown() { foreach ($this->fixtures as $fixture) { - $message = 'Tear down fixture ' . get_class($fixture); - Log::getInstance()->customLogToFileForDebuggingIfYouStillSeeThisHereRemoveIt($message, false); $fixture->tearDown(); } }