diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-10-07 00:47:11 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-10-07 00:47:22 +0400 |
commit | 6c11ad21c86a3bac8111d5a4c08bc635984d2129 (patch) | |
tree | ff7d27edc8483e65ee0a39f0247e011e1855f843 /plugins | |
parent | 57501bfc33ed680cdde8c9177e8dc0ea42005011 (diff) |
Removed Piwik::log and replace with calls to Log::... functions. Also changed logging level on travis.
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/PrivacyManager/LogDataPurger.php | 6 | ||||
-rw-r--r-- | plugins/SEO/RankChecker.php | 5 | ||||
-rwxr-xr-x | plugins/UserCountry/GeoIPAutoUpdater.php | 15 | ||||
-rwxr-xr-x | plugins/UserCountry/LocationProvider/GeoIp/Php.php | 5 |
4 files changed, 17 insertions, 14 deletions
diff --git a/plugins/PrivacyManager/LogDataPurger.php b/plugins/PrivacyManager/LogDataPurger.php index 9799dc0213..9a60af5781 100755 --- a/plugins/PrivacyManager/LogDataPurger.php +++ b/plugins/PrivacyManager/LogDataPurger.php @@ -14,6 +14,7 @@ use Piwik\Common; use Piwik\Date; use Piwik\Db; use Piwik\Piwik; +use Piwik\Log; /** * Purges the log_visit, log_conversion and related tables of old visit data. @@ -85,7 +86,7 @@ class LogDataPurger $this->purgeUnusedLogActions(); } else { $logMessage = get_class($this) . ": LOCK TABLES privilege not granted; skipping unused actions purge"; - Piwik::log($logMessage); + Log::warning($logMessage); } // optimize table overhead after deletion @@ -323,5 +324,4 @@ class LogDataPurger $settings['delete_logs_max_rows_per_query'] ); } -} - +}
\ No newline at end of file diff --git a/plugins/SEO/RankChecker.php b/plugins/SEO/RankChecker.php index 9584d4bc2a..373a2eabea 100644 --- a/plugins/SEO/RankChecker.php +++ b/plugins/SEO/RankChecker.php @@ -14,6 +14,7 @@ use Exception; use Piwik\Http; use Piwik\MetricsFormatter; use Piwik\Piwik; +use Piwik\Log; /** * The functions below are derived/adapted from GetRank.org's @@ -190,7 +191,7 @@ class RankChecker $majesticInfo = $this->getMajesticInfo(); return $majesticInfo['backlink_count']; } catch (Exception $e) { - Piwik::log($e->getMessage()); + Log::info($e); return 0; } } @@ -206,7 +207,7 @@ class RankChecker $majesticInfo = $this->getMajesticInfo(); return $majesticInfo['referrer_domains_count']; } catch (Exception $e) { - Piwik::log($e->getMessage()); + Log::info($e); return 0; } } diff --git a/plugins/UserCountry/GeoIPAutoUpdater.php b/plugins/UserCountry/GeoIPAutoUpdater.php index cb7deb50a7..2bd9362fea 100755 --- a/plugins/UserCountry/GeoIPAutoUpdater.php +++ b/plugins/UserCountry/GeoIPAutoUpdater.php @@ -12,6 +12,7 @@ namespace Piwik\Plugins\UserCountry; use Exception; use Piwik\Piwik; +use Piwik\Log; use Piwik\Common; use Piwik\Date; use Piwik\Http; @@ -78,7 +79,7 @@ class GeoIPAutoUpdater } } catch (Exception $ex) { // message will already be prefixed w/ 'GeoIPAutoUpdater: ' - Piwik::log($ex->getMessage()); + Log::error($ex); $this->performRedundantDbChecks(); throw $ex; } @@ -120,7 +121,7 @@ class GeoIPAutoUpdater . "'$zippedOutputPath'! (Unknown error)"); } - Piwik::log(sprintf("GeoIPAutoUpdater: successfully downloaded '%s'", $url)); + Log::info("GeoIPAutoUpdater: successfully downloaded '%s'", $url); try { self::unzipDownloadedFile($zippedOutputPath, $unlink = true); @@ -129,7 +130,7 @@ class GeoIPAutoUpdater . "downloading " . "'$url': " . $ex->getMessage()); } - Piwik::log(sprintf("GeoIPAutoUpdater: successfully updated GeoIP database '%s'", $url)); + Log::info("GeoIPAutoUpdater: successfully updated GeoIP database '%s'", $url); } /** @@ -221,8 +222,8 @@ class GeoIPAutoUpdater ) { if (self::$unzipPhpError !== null) { list($errno, $errstr, $errfile, $errline) = self::$unzipPhpError; - Piwik::log("GeoIPAutoUpdater: Encountered PHP error when testing newly downloaded" . - " GeoIP database: $errno: $errstr on line $errline of $errfile."); + Log::info("GeoIPAutoUpdater: Encountered PHP error when testing newly downloaded" . + " GeoIP database: %s: %s on line %s of %s.", $errno, $errstr, $errline, $errfile); } throw new Exception(Piwik_Translate('UserCountry_ThisUrlIsNotAValidGeoIPDB')); @@ -530,8 +531,8 @@ class GeoIPAutoUpdater self::getTestLocationCatchPhpErrors($provider); if (self::$unzipPhpError !== null) { list($errno, $errstr, $errfile, $errline) = self::$unzipPhpError; - Piwik::log("GeoIPAutoUpdater: Encountered PHP error when performing redundant " . - "tests on GeoIP $type database: $errno: $errstr on line $errline of $errfile."); + Log::warning("GeoIPAutoUpdater: Encountered PHP error when performing redundant tests on GeoIP " + . "%s database: %s: %s on line %s of %s.", $type, $errno, $errstr, $errline, $errfile); // get the current filename for the DB and an available new one to rename it to list($oldPath, $newPath) = $this->getOldAndNewPathsForBrokenDb($customNames[$type]); diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Php.php b/plugins/UserCountry/LocationProvider/GeoIp/Php.php index 7bd9ba0e26..e3fd8a369a 100755 --- a/plugins/UserCountry/LocationProvider/GeoIp/Php.php +++ b/plugins/UserCountry/LocationProvider/GeoIp/Php.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\UserCountry\LocationProvider\GeoIp; use Piwik\Piwik; +use Piwik\Log; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; /** @@ -129,7 +130,7 @@ class Php extends GeoIp $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip); break; default: // unknown database type, log warning and fallback to country edition - Piwik::log(sprintf("Found unrecognized database type: %s", $locationGeoIp->databaseType)); + Log::warning("Found unrecognized database type: %s", $locationGeoIp->databaseType); $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip); break; @@ -206,7 +207,7 @@ class Php extends GeoIp if ($geoIpError) { list($errno, $errstr, $errfile, $errline) = $geoIpError; - Piwik::log("Got GeoIP error when testing PHP GeoIP location provider: $errfile($errline): $errstr"); + Log::warning("Got GeoIP error when testing PHP GeoIP location provider: %s(%s): %s", $errfile, $errline, $errstr); return Piwik_Translate('UserCountry_GeoIPIncorrectDatabaseFormat'); } |