From 2ddc9496e9403a59a87b644d1c2b9a106b773e46 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Thu, 5 Aug 2010 10:08:33 -0400 Subject: Added an optional second parameter to show_404() to disable logging. --- system/core/Common.php | 4 ++-- system/core/Exceptions.php | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'system') diff --git a/system/core/Common.php b/system/core/Common.php index 9dee591e6..2b8ad26b1 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -317,10 +317,10 @@ * @access public * @return void */ - function show_404($page = '') + function show_404($page = '', $log_error = TRUE) { $_error =& load_class('Exceptions', 'core'); - $_error->show_404($page); + $_error->show_404($page, $log_error); exit; } diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index 503015dfd..419ea2b61 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -88,12 +88,17 @@ class CI_Exceptions { * @param string * @return string */ - function show_404($page = '') + function show_404($page = '', $log_error = TRUE) { $heading = "404 Page Not Found"; $message = "The page you requested was not found."; - log_message('error', '404 Page Not Found --> '.$page); + // By default we log this, but allow a dev to skip it + if ($log_error) + { + log_message('error', '404 Page Not Found --> '.$page); + } + echo $this->show_error($heading, $message, 'error_404', 404); exit; } -- cgit v1.2.3-24-g4f1b