LogLevel codes |
|||
|---|---|---|---|
| Date: | 08/01/2007 | Severity: | Trivial |
| Status: | Bogus | Reporter: | redBaron |
| Version: | 1.5.3 | ||
| Keywords: | |||
Description
The loglevel order in “libraries/Log.php” is wrong which leads to the situation that the effect of the setting “log_threshold” is virtually on/off.
Currently, on line 33 of Log.php, we have:
var $levels = array(
‘ERROR’ => ‘1’,
‘DEBUG’ => ‘2’,
‘INFO’ => ‘3’,
‘ALL’ => ‘4’);
which will not allow the threshold checking code to filter out debug messages when the loglevel INFO is set.
We need to change this to
var $levels = array(
‘ERROR’ => ‘1’,
‘INFO’ => ‘2’,
‘DEBUG’ => ‘3’,
‘ALL’ => ‘4’);
and also fix the comment in “config.php” where the threshold is set and explained.
Expected Result
Actual Result
Comment on Bug Report
| Posted by: Derek Allard on 1 August 2007 9:06am | |
|
|
I’m not sure I’m following. Informational messages are intended to be of a higher threshold then debug messages. They are only used if an application author generates them as CI doesn’t generate any info messages natively. Are you seeing different behaviour? |
| Posted by: redBaron on 1 August 2007 10:03am | |
|
|
I probably miss-interpreted the log levels completely. My understanding is that in logging, the levels are ordered quite naturally, weighted by their importance to the administrator and debugger, for me this is ALL,DEBUG,INFO,ERROR which whould give me all available log information when set to DEBUG/ALL and nothing but errors when set to ERROR. Thus I would expect to get only messages of type INFO and ERROR when my threshold is set to INFO. Our application uses INFO internally, to allow some moderate log levels but not fill the disk as it happens with DEBUG. Now, when set to threshold 3 (INFO) this will still print all DEBUG messages, something we just want to prevent . Therefore I would propose to alter the order of the levels which will allow INFO messages without DEBUG and still work with the existing threshold implementation. This is quite in line with logging frameworks like log4j or log4php. Regards, |
