Merge pull request #1682 from dhinus/patch-1
Logging should obey error_reporting() setting
diff --git a/system/core/Common.php b/system/core/Common.php
index e449dd2..981af45 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -520,20 +520,19 @@
{
$_error =& load_class('Exceptions', 'core');
- // Should we display the error? We'll get the current error_reporting
+ // Should we ignore the error? We'll get the current error_reporting
// level and add its bits with the severity bits to find out.
- // And respect display_errors
- if (($severity & error_reporting()) === $severity && (bool) ini_get('display_errors') === TRUE)
- {
- $_error->show_php_error($severity, $message, $filepath, $line);
- }
-
- // Should we log the error? No? We're done...
- if (config_item('log_threshold') === 0)
+ if (($severity & error_reporting()) !== $severity)
{
return;
}
+ // Should we display the error?
+ if ((bool) ini_get('display_errors') === TRUE)
+ {
+ $_error->show_php_error($severity, $message, $filepath, $line);
+ }
+
$_error->log_exception($severity, $message, $filepath, $line);
}
}