BryanDavis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/261641

Change subject: Exclude debug log events marked "private" from MWDebug
......................................................................

Exclude debug log events marked "private" from MWDebug

Respect the "private" context variable for debug log events when passing
events from MediaWiki\Logger\LegacyLogger to MWDebug::debugMsg. Passing
debug log events marked as private to MWDebug  was a regression
introduced by the PSR-3 logging system.

Bug: T122644
Change-Id: Ib1d999b8b54e584e3944b46e9163a700f11c2e72
---
M includes/GlobalFunctions.php
M includes/debug/logger/LegacyLogger.php
2 files changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/261641/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index e30b371..1e2278d 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1137,17 +1137,10 @@
 function wfDebugLog(
        $logGroup, $text, $dest = 'all', array $context = array()
 ) {
-       // Turn $dest into a string if it's a boolean (for b/c)
-       if ( $dest === true ) {
-               $dest = 'all';
-       } elseif ( $dest === false ) {
-               $dest = 'private';
-       }
-
        $text = trim( $text );
 
        $logger = LoggerFactory::getInstance( $logGroup );
-       $context['private'] = ( $dest === 'private' );
+       $context['private'] = ( $dest === false || $dest === 'private' );
        $logger->info( $text, $context );
 }
 
diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index ef7d819..5d681f6 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -90,8 +90,10 @@
                        $destination = self::destination( $this->channel, 
$message, $context );
                        self::emit( $text, $destination );
                }
-               // Add to debug toolbar
-               MWDebug::debugMsg( $message, array( 'channel' => $this->channel 
) + $context );
+               if ( !isset( $context['private'] ) || !$context['private'] ) {
+                       // Add to debug toolbar if not marked as "private"
+                       MWDebug::debugMsg( $message, array( 'channel' => 
$this->channel ) + $context );
+               }
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/261641
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1d999b8b54e584e3944b46e9163a700f11c2e72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to