summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2013-01-06 03:33:46 +0100
committerAndrey Andreev <narf@bofh.bg>2013-01-06 03:33:46 +0100
commit828f4c9d9ace922f5135742170d489d811548b04 (patch)
treec11816d188e1a77c882f78c1b7904a5b48c2f3d5 /system/core/Common.php
parent762572f45a14418c9259527e377a1df78a651618 (diff)
parent4c22364e12268961aac3ba0f2a4b60a066a16bcd (diff)
Merge pull request #2121 from TheDigitalOrchard/develop
utilize static function variables in Common::log_message() to "cache" lo...
Diffstat (limited to 'system/core/Common.php')
-rw-r--r--system/core/Common.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index a4b4f2b3e..d494caf80 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -413,14 +413,23 @@ if ( ! function_exists('log_message'))
*/
function log_message($level = 'error', $message, $php_error = FALSE)
{
- static $_log;
+ static $_log, $_log_threshold;
+
+ if ($_log_threshold === NULL)
+ {
+ $_log_threshold = config_item('log_threshold');
+ }
- if (config_item('log_threshold') === 0)
+ if ($_log_threshold === 0)
{
return;
}
- $_log =& load_class('Log', 'core');
+ if ($_log === NULL)
+ {
+ $_log =& load_class('Log', 'core');
+ }
+
$_log->write_log($level, $message, $php_error);
}
}