From dca62b82d1b4163d52280c9a128e49daf1de4bf4 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sun, 15 Sep 2013 12:02:07 -0400 Subject: [PATCH] Removed unnecessary sanity checks when calling Log --- classes/Controller.php | 5 +---- classes/Database/PDO/Common.php | 2 +- classes/Dynamic.php | 10 ++-------- classes/Error.php | 2 +- classes/Model.php | 14 ++------------ 5 files changed, 7 insertions(+), 26 deletions(-) diff --git a/classes/Controller.php b/classes/Controller.php index 28d78d9..038781d 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -116,10 +116,7 @@ class Controller extends Object } else { - if ($this->config->pickles['logging'] === true) - { - Log::warning('Class named ' . $module_class . ' was not found in ' . $module_filename); - } + Log::warning('Class named ' . $module_class . ' was not found in ' . $module_filename); } } diff --git a/classes/Database/PDO/Common.php b/classes/Database/PDO/Common.php index 5d8c1b2..a5aca21 100644 --- a/classes/Database/PDO/Common.php +++ b/classes/Database/PDO/Common.php @@ -227,7 +227,7 @@ class Database_PDO_Common extends Database_Common $end_time = microtime(true); $duration = $end_time - $start_time; - if ($this->config->pickles['logging'] === true && $duration >= 1) + if ($duration >= 1) { Log::slowQuery($duration . ' seconds: ' . $loggable_query); } diff --git a/classes/Dynamic.php b/classes/Dynamic.php index 99c2f18..ea7d6ee 100644 --- a/classes/Dynamic.php +++ b/classes/Dynamic.php @@ -205,10 +205,7 @@ class Dynamic extends Object } else { - if ($this->config->pickles['logging'] === true) - { - Log::warning('Unable to minify ' . $original_reference . ' and a minified copy does not already exist'); - } + Log::warning('Unable to minify ' . $original_reference . ' and a minified copy does not already exist'); } $reference = $this->reference($reference); @@ -278,10 +275,7 @@ class Dynamic extends Object } else { - if ($this->config->pickles['logging'] === true) - { - Log::warning('Unable to minify ' . $original_reference . ' and a minified copy does not already exist'); - } + Log::warning('Unable to minify ' . $original_reference . ' and a minified copy does not already exist'); } $reference = $this->reference($reference); diff --git a/classes/Error.php b/classes/Error.php index 6c5a1aa..3ad0c63 100644 --- a/classes/Error.php +++ b/classes/Error.php @@ -38,7 +38,7 @@ class Error { if (Log::error($message) == false) { - $message .= '

This error message could not be logged as the log path or log file is not writable'; + $message .= '

This error message could not be logged as the log path or log file is not writable'; } } ?> diff --git a/classes/Model.php b/classes/Model.php index 84d8b64..9d130c2 100644 --- a/classes/Model.php +++ b/classes/Model.php @@ -1356,8 +1356,6 @@ class Model extends Object // Clears the cache if ($update && $this->use_cache) { - Log::information('CACHE: Deleted Keys: ' . implode(', ', $cache_keys)); - $this->cache->delete($cache_keys); } @@ -1529,11 +1527,7 @@ class Model extends Object // Clears the cache if ($update && $this->use_cache) { - $cache_key = strtoupper($this->model) . '-' . $this->record[$this->columns['id']]; - - Log::information('CACHE: Delete Key: ' . $cache_key); - - $this->cache->delete($cache_key); + $this->cache->delete(strtoupper($this->model) . '-' . $this->record[$this->columns['id']]); } return $results; @@ -1587,11 +1581,7 @@ class Model extends Object // Clears the cache if ($this->use_cache) { - $cache_key = strtoupper($this->model) . '-' . $this->record[$this->columns['id']]; - - Log::information('CACHE: Deleted Key: ' . $cache_key); - - $this->cache->delete($cache_key); + $this->cache->delete(strtoupper($this->model) . '-' . $this->record[$this->columns['id']]); } return $results;