Allow to disable specific groups in $wgDebugLogGroups
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Thu, 6 Feb 2014 22:00:43 +0000 (23:00 +0100)
committerIAlex <codereview@emsenhuber.ch>
Wed, 26 Feb 2014 20:46:14 +0000 (20:46 +0000)
So that they don't even appear in $wgDebugLogFile.

Change-Id: Ibf1a28fa566915d790e4d915354238441c3ff5c7

includes/DefaultSettings.php
includes/GlobalFunctions.php

index 716baef..b9b471c 100644 (file)
@@ -4951,10 +4951,12 @@ $wgDebugDumpSql = false;
  * of the regular $wgDebugLogFile. Useful for enabling selective logging
  * in production.
  *
- * Log destinations may be string values specifying a filename or URI, or they
- * may be filename or an associative array mapping 'destination' to the desired
- * filename. The associative array may also contain a 'sample' key with an
- * integer value, specifying a sampling factor.
+ * Log destinations may be one of the following:
+ * - false to completely remove from the output, including from $wgDebugLogFile.
+ * - string values specifying a filename or URI.
+ * - associative array mapping 'destination' key to the desired filename or URI.
+ *   The associative array may also contain a 'sample' key with an integer value,
+ *   specifying a sampling factor.
  *
  * @par Example:
  * @code
index 6785d0c..a6f936f 100644 (file)
@@ -1064,6 +1064,9 @@ function wfDebugLog( $logGroup, $text, $dest = 'all' ) {
        }
 
        $logConfig = $wgDebugLogGroups[$logGroup];
+       if ( $logConfig === false ) {
+               return;
+       }
        if ( is_array( $logConfig ) ) {
                if ( isset( $logConfig['sample'] ) && mt_rand( 1, $logConfig['sample'] ) !== 1 ) {
                        return;