--- includes/common.inc.orig	2004-08-23 22:22:15.914286290 -0400
+++ includes/common.inc	2004-08-23 22:38:06.328249082 -0400
@@ -396,16 +396,24 @@
 /* @} */
 
 /**
- * Log errors in the database rather than displaying them to the user.
+ * Log errors as defined by administrator
+ * Error levels:
+ *  0 = Disabled, no errors are logged
+ *  1 = Log important errors to database
+ *  2 = Log all errors to database
+ *  3 = Log all errors to database and important errors to screen
+ *  4 = Log all errors to database and to screen
  */
 function error_handler($errno, $message, $filename, $line, $variables) {
-  $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 ($errno & (E_ALL ^ E_NOTICE)) {
-    watchdog('error', t('%error: %message in %file on line %line.', array('%error' => $types[$errno], '%message' => $message, '%file' => $filename, '%line' => $line)));
-    if (error_reporting()) {
-      print '<pre>'. $entry .'</pre>';
+  if ($error_level = variable_get('error_level', 3)) {
+    $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 (($error_level > 1 || ($error_level == 1 && error_reporting())) && ($errno & E_ALL ^ E_NOTICE)) {
+      watchdog('error', t('%error: %message in %file on line %line.', array('%error' => $types[$errno], '%message' => $message, '%file' => $filename, '%line' => $line)));
+      if ($error_level > 3 || ($error_level == 3 && error_reporting())) {
+        print '<pre>'. $entry .'</pre>';
+      }
     }
   }
 }
--- includes/bootstrap.inc.orig	2004-08-23 22:22:15.914286290 -0400
+++ includes/bootstrap.inc	2004-08-23 22:22:15.858292133 -0400
@@ -123,7 +123,7 @@
 function cache_set($cid, $data, $expire = 0, $headers = NULL) {
   db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid);
   if (!db_affected_rows()) {
-    db_query("INSERT INTO {cache} (cid, data, created, expire, headers) VALUES('%s', '%s', %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
+    @db_query("INSERT INTO {cache} (cid, data, created, expire, headers) VALUES('%s', '%s', %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
   }
 }
 
--- modules/system.module.orig	2004-08-23 22:22:16.079269075 -0400
+++ modules/system.module	2004-08-23 22:32:19.835441592 -0400
@@ -244,6 +244,9 @@
 
   $output .= form_group(t('Date settings'), $group);
 
+  $group = form_select(t('Error logging'), 'error_level', variable_get('error_level', 2), array('Disabled', 'Log important errors to database', 'Log all errors to database', 'Log all errors to database and important errors to screen', 'Log all errors to database and to screen'), t('Configure how Drupal logs errors.'));
+  $output .= form_group(t('Error settings'), $group);
+
   return $output;
 }
 
--- modules/node.module.orig	2004-08-23 22:29:25.931835672 -0400
+++ modules/node.module	2004-08-23 22:28:31.380690670 -0400
@@ -110,7 +110,7 @@
       db_query('UPDATE {history} SET timestamp = %d WHERE uid = %d AND nid = %d', time(), $user->uid, $nid);
     }
     else {
-      db_query('INSERT INTO {history} (uid, nid, timestamp) VALUES (%d, %d, %d)', $user->uid, $nid, time());
+      @db_query('INSERT INTO {history} (uid, nid, timestamp) VALUES (%d, %d, %d)', $user->uid, $nid, time());
     }
   }
 }
