diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-07-01 10:49:19 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-07-01 10:49:19 +0400 |
commit | 3e2260913657b051cb73f9fdf1d4378ccc6c0b88 (patch) | |
tree | 7a61bc2871e84a07203802d410a914002903a069 /core/Profiler.php | |
parent | 771220c82eaf372166886d372830a3a5c5495dd4 (diff) |
Add support for --force-date-range parameter + also enable Verbose logging via -v
refs https://github.com/piwik/piwik/pull/319
refs #5396
Diffstat (limited to 'core/Profiler.php')
-rw-r--r-- | core/Profiler.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/Profiler.php b/core/Profiler.php index bcbf67019c..e3a62f7049 100644 --- a/core/Profiler.php +++ b/core/Profiler.php @@ -52,7 +52,8 @@ class Profiler $profiler = Db::get()->getProfiler(); if (!$profiler->getEnabled()) { - throw new \Exception("To display the profiler you should enable enable_sql_profiler on your config/config.ini.php file"); + // To display the profiler you should enable enable_sql_profiler on your config/config.ini.php file + return; } $infoIndexedByQuery = array(); @@ -133,7 +134,9 @@ class Profiler { $totalTime = self::getDbElapsedSecs(); $queryCount = Profiler::getQueryCount(); - Log::debug(sprintf("Total queries = %d (total sql time = %.2fs)", $queryCount, $totalTime)); + if($queryCount > 0) { + Log::debug(sprintf("Total queries = %d (total sql time = %.2fs)", $queryCount, $totalTime)); + } } /** |