Love this, made some changes that others may be interested in:
In MY_controller added this function
function _fireignition_message($message)
{
if(!function_exists('fireignition_message')){
static $LOG;
$config =& get_config();
if ($config['fireignition'] === false)
{
return;
}
$LOG =& load_class('Log');
$LOG->fireignition_log($message);
return;
}
fireignition_message($message);
return;
}
Then in MY_Log.php I added
var $_writeLog = false;
and changed the function MY_Log and write_log to
function MY_Log() {
$config =& get_config();
$this->_fireignition = isset($config['fireignition']) ? $config['fireignition'] : false;
if(isset($config['log_file'])){
$this->_writeLog = $config['log_file'];
}else{
$this->_writeLog = (isset($config['log_threshold']) && $config['log_threshold']>0) ? true : false;
}
parent::CI_Log();
}
function write_log($level = 'error', $msg, $php_error = FALSE) {
if ($this->_fireignition)
{
$level = strtoupper($level);
if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold))
{
return FALSE;
}
$this->_log .= strtoupper($level).' '.(($level == 'INFO') ? ' -' : '-').' '.date($this->_date_fmt). ' --> '.$msg."\n" . '<br />';
}
if($this->_writeLog){
parent::write_log($level, $msg, $php_error);
}
}
In the core config near $config[‘log_threshold’] = 0; I added $config[‘log_file’] = FALSE; though if left out the log_threshold >0 it assumes log_file is true.
Usage has changed from fireignition_message(‘message’); to $this->_fireignition_message(‘message’);
What does this mean:
1. If threshold is set to 0 but fireignition variable is left to true, you no longer get an error message about the function not being available.
2. This allows you to have firephp output on without logging, it also lets you set threshold to whatever output you want to be available to firephp without writing log files.
Hope this is some help, fire ignition has brought something to my coding I always wanted, thanks a lot to the author, hope you don’t mind me posting the above.