CodeIgniter Forums

Full Version: CI_Log override disabled by Common::log_message()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Shouldn't it be $_log =& load_class('Log', 'core');

Code:
function log_message($level = 'error', $message, $php_error = FALSE)
    {
        static $_log;

        if (config_item('log_threshold') == 0)
        {
            return;
        }

        $_log =& load_class('Log', 'core');
        $_log->write_log($level, $message, $php_error);
    }

instead of $_log =& load_class('Log');

Code:
function log_message($level = 'error', $message, $php_error = FALSE)
    {
        static $_log;

        if (config_item('log_threshold') == 0)
        {
            return;
        }

        $_log =& load_class('Log');
        $_log->write_log($level, $message, $php_error);
    }

that prevents me from loading MY_Log, because default CI_Log loads first.

El Forum

[eluser]Unknown[/eluser]
OK, I moved MY_Log from core to libraries. That seemed to work.