? boost-531100.patch
Index: boost.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.admin.inc,v
retrieving revision 1.1.2.1.2.3.2.41
diff -u -p -r1.1.2.1.2.3.2.41 boost.admin.inc
--- boost.admin.inc	28 Jul 2009 00:52:14 -0000	1.1.2.1.2.3.2.41
+++ boost.admin.inc	28 Jul 2009 23:33:40 -0000
@@ -286,6 +286,16 @@ function boost_admin_boost_performace_pa
     '#options'       => array(0 => t('Disabled'), 1 => t('Only Ignore Complete Flushes'), 2 => t('Ignore Fluses & Expiration'), 3 => t('Ignore All Delete Commands (Not Recommended)')),
     '#description'   => t('Enable to put your site into a static state. Recommend turning on CSS & JS caching if enabled.'),
   );
+  $form['advanced']['boost_verbose'] = array(
+    '#type'          => 'select',
+    '#title'         => t('Verbose Setting'),
+    '#default_value' => BOOST_VERBOSE,
+    '#options'       => array(
+      1 => t('1 Show almost no errors'),
+      3 => t('3'),
+      5 => t('5 Show all'),
+    ),
+  );
 
   // Apache .htaccess settings generation
   $htaccess = boost_admin_generate_htaccess(variable_get('boost_server_name_http_host', '%{SERVER_NAME}'), variable_get('boost_document_root', '%{DOCUMENT_ROOT}'), 'cache', 'gz', variable_get('boost_file_extension', '.html'));
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.80
diff -u -p -r1.3.2.2.2.5.2.80 boost.module
--- boost.module	28 Jul 2009 01:11:22 -0000	1.3.2.2.2.5.2.80
+++ boost.module	28 Jul 2009 23:33:41 -0000
@@ -41,6 +41,7 @@ define('BOOST_PERMISSIONS_FILE',     var
 define('BOOST_PERMISSIONS_DIR',      variable_get('boost_permissions_dir', ''));
 define('BOOST_OVERWRITE_FILE',       variable_get('boost_overwrite_file', FALSE));
 define('BOOST_DISABLE_CLEAN_URL',    variable_get('boost_disable_clean_url', FALSE));
+define('BOOST_VERBOSE',              variable_get('boost_verbose', 5));
 
 // This cookie is set for all authenticated users, so that they can be
 // excluded from caching (or in the future get a user-specific cached page):
@@ -257,7 +258,9 @@ function boost_cron() {
 
   // Expire old content
   if (variable_get('boost_expire_cron', TRUE) && boost_cache_db_expire()) {
-    watchdog('boost', 'Expired stale files from static page cache.', array(), WATCHDOG_NOTICE);
+    if (BOOST_VERBOSE >= 5) {
+      watchdog('boost', 'Expired stale files from static page cache.', array(), WATCHDOG_NOTICE);
+    }
   }
 
   // Update Stats
@@ -633,13 +636,17 @@ function _boost_ob_handler($buffer) {
       //case E_USER_DEPRECATED: //Ignore user-generated notice message
         break;
       default: //Do not cache page on all other errors
-        watchdog('boost', 'There are <strong>php errors</strong> on this page, preventing boost from caching. ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => boost_print_r($error, TRUE), '!link' => l(t('Lookup Error Type'), 'http://php.net/errorfunc.constants'), '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')), WATCHDOG_WARNING);
+        if (BOOST_VERBOSE >= 3) {
+          watchdog('boost', 'There are <strong>php errors</strong> on this page, preventing boost from caching. ERROR: <pre>%error</pre> !link <br /> !performance', array('%error' => boost_print_r($error, TRUE), '!link' => l(t('Lookup Error Type'), 'http://php.net/errorfunc.constants'), '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')), WATCHDOG_WARNING);
+        }
         return $buffer;
       }
     }
   }
   if (BOOST_HALT_ON_ERRORS && $GLOBALS['_boost_message_count'] != 0) {
-    watchdog('boost', 'There are <strong>drupal messages</strong> on this page, preventing boost from caching. MESSAGES: %msg <br /> !performance', array('%msg' => $GLOBALS['_boost_message_count'], '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')), WATCHDOG_WARNING);
+    if (BOOST_VERBOSE >= 3) {
+      watchdog('boost', 'There are <strong>drupal messages</strong> on this page, preventing boost from caching. MESSAGES: %msg <br /> !performance', array('%msg' => $GLOBALS['_boost_message_count'], '!performance' => l(t('Turn Off Error Checking'), 'admin/settings/performance')), WATCHDOG_WARNING);
+    }
     return $buffer;
   }
 
@@ -778,7 +785,9 @@ function boost_cache_clear_all() {
   if (BOOST_IGNORE_FLUSH == 0) {
     boost_cache_clear_all_db();
     boost_cache_delete(TRUE);
-    watchdog('boost', 'Flushed ALL files from static page cache.', array(), WATCHDOG_NOTICE);
+    if (BOOST_VERBOSE >= 5) {
+      watchdog('boost', 'Flushed ALL files from static page cache.', array(), WATCHDOG_NOTICE);
+    }
     return TRUE;
   }
   return FALSE;
@@ -1118,11 +1127,15 @@ function boost_get_settings_db($router_i
  */
 function boost_cache_write($filename, $data = '') {
   if (!_boost_mkdir_p(dirname($filename))) {
-    watchdog('boost', 'Unable to create directory: %dir<br /> Group ID: %gid<br /> User ID: %uid<br /> Current script owner: %user<br />', array('%dir' => dirname($filename), '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user()), WATCHDOG_WARNING);
+    if (BOOST_VERBOSE >= 3) {
+      watchdog('boost', 'Unable to create directory: %dir<br /> Group ID: %gid<br /> User ID: %uid<br /> Current script owner: %user<br />', array('%dir' => dirname($filename), '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user()), WATCHDOG_WARNING);
+    }
   }
   $tempfile = $filename . getmypid();
   if (@file_put_contents($tempfile, $data) === FALSE) {
-    watchdog('boost', 'Unable to write temp file: %file<br /> Group ID: %gid<br /> User ID: %uid<br /> Current script owner: %user<br />', array('%file' => $tempfile, '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user()), WATCHDOG_WARNING);
+    if (BOOST_VERBOSE >= 3) {
+      watchdog('boost', 'Unable to write temp file: %file<br /> Group ID: %gid<br /> User ID: %uid<br /> Current script owner: %user<br />', array('%file' => $tempfile, '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user()), WATCHDOG_WARNING);
+    }
     return FALSE;
   }
   else {
@@ -1131,7 +1144,9 @@ function boost_cache_write($filename, $d
     }
     // put the temp file in its final location
     if (@rename($tempfile, $filename) === FALSE) {
-      //watchdog('boost', 'Unable to rename file: %temp  to  %file<br /> Group ID: %gid<br /> User ID: %uid<br /> Current script owner: %user<br />', array('%temp' => $tempfile, '%file' => $filename, '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user()), WATCHDOG_WARNING);
+      if (BOOST_VERBOSE >= 5) {
+        watchdog('boost', 'Unable to rename file: %temp  to  %file<br /> Group ID: %gid<br /> User ID: %uid<br /> Current script owner: %user<br />', array('%temp' => $tempfile, '%file' => $filename, '%gid' => getmygid(), '%uid' => getmyuid(), '%user' => get_current_user()), WATCHDOG_WARNING);
+      }
       @unlink($tempfile);
       return FALSE;
     }
@@ -1150,7 +1165,9 @@ function boost_cache_write($filename, $d
 function boost_cache_directory($host = NULL, $absolute = TRUE) {
   global $base_url;
   if ($base_url == "http://") {
-    watchdog('boost', 'base_url is not set in your settings.php file. Please read #7 in boosts INSTALL.txt file.', array(), WATCHDOG_NOTICE);
+    if (BOOST_VERBOSE >= 1) {
+      watchdog('boost', 'base_url is not set in your settings.php file. Please read #7 in boosts INSTALL.txt file.', array(), WATCHDOG_NOTICE);
+    }
     if (!BOOST_MULTISITE_SINGLE_DB) {
       $base_url = $base_url . str_replace(BOOST_ROOT_CACHE_PATH . '/', '', variable_get('boost_file_path', boost_cache_directory(NULL, FALSE)));
     }
