[drupal-devel] [bug] Bug with error_level in includes/common.inc?
Uwe Hermann
drupal-devel at drupal.org
Sun Aug 21 20:13:53 UTC 2005
Issue status update for
http://drupal.org/node/25084
Post a follow up:
http://drupal.org/project/comments/add/25084
Project: Drupal
-Version: 4.6.1
+Version: cvs
Component: base system
Category: bug reports
Priority: minor
Assigned to: Anonymous
Reported by: jasonmcmunn
Updated by: Uwe Hermann
-Status: active
+Status: patch (code needs review)
Attachment: http://drupal.org/files/issues/common_12.patch (680 bytes)
AFAIK it's not the code that is wrong but the docs. Here's a patch.
Someone should review this before committing.
Uwe Hermann
Previous comments:
------------------------------------------------------------------------
Wed, 15 Jun 2005 17:35:45 +0000 : jasonmcmunn
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 '<pre>'. $entry .'</pre>';
}
More information about the drupal-devel
mailing list