From 19084be0a2a11725bb319ca7137cedfc159daef1 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 6 Feb 2014 23:00:43 +0100 Subject: [PATCH] Allow to disable specific groups in $wgDebugLogGroups So that they don't even appear in $wgDebugLogFile. Change-Id: Ibf1a28fa566915d790e4d915354238441c3ff5c7 --- includes/DefaultSettings.php | 10 ++++++---- includes/GlobalFunctions.php | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 716baeff7b..b9b471c23a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6785d0c940..a6f936fa6d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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; -- 2.20.1