In the following code it says that it will log to the database if it is set to 1, and log to the screen if it is set to 2. Well, as it stands, it logs to the screen if it's one and not two.
very easy fix, just change the two 1s to 2s.
/**
* Log errors as defined by administrator
* Error levels:
* 1 = Log errors to database.
* 2 = Log errors to database and to screen.
*/
function error_handler($errno, $message, $filename, $line) {
if ($errno & (E_ALL ^ E_NOTICE)) {
$types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning');
$entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.';
if (variable_get('error_level', 1) == 1) {
print '<code>'. $entry .'
';
}
Comments
Comment #1
Uwe Hermann commentedAFAIK it's not the code that is wrong but the docs. Here's a patch. Someone should review this before committing.
Comment #2
dries commentedCommitted to HEAD. Thanks.
Comment #3
(not verified) commentedComment #4
(not verified) commentedComment #5
(not verified) commented