CodeIgniter Forums
CI_Log override disabled by Common::log_message() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI_Log override disabled by Common::log_message() (/showthread.php?tid=43937)



CI_Log override disabled by Common::log_message() - El Forum - 07-28-2011

[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.


CI_Log override disabled by Common::log_message() - El Forum - 07-28-2011

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