Merge "UploadBooklet: Switch on showDropTarget in the SelectFileWidget"
[lhc/web/wiklou.git] / includes / debug / logger / LegacyLogger.php
index ef7d819..23c3102 100644 (file)
@@ -90,8 +90,10 @@ class LegacyLogger extends AbstractLogger {
                        $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 );
+               }
        }
 
        /**
@@ -116,6 +118,13 @@ class LegacyLogger extends AbstractLogger {
                        // All messages on the wfErrorLog channel should be emitted.
                        $shouldEmit = true;
 
+               } elseif ( $channel === 'wfDebug' ) {
+                       // wfDebug messages are emitted if a catch all logging file has
+                       // been specified. Checked explicitly so that 'private' flagged
+                       // messages are not discarded by unset $wgDebugLogGroups channel
+                       // handling below.
+                       $shouldEmit = $wgDebugLogFile != '';
+
                } elseif ( isset( $wgDebugLogGroups[$channel] ) ) {
                        $logConfig = $wgDebugLogGroups[$channel];
 
@@ -273,13 +282,7 @@ class LegacyLogger extends AbstractLogger {
                        $cachedTimezone = new DateTimeZone( $wgDBerrorLogTZ );
                }
 
-               // Workaround for https://bugs.php.net/bug.php?id=52063
-               // Can be removed when min PHP > 5.3.6
-               if ( $cachedTimezone === null ) {
-                       $d = date_create( 'now' );
-               } else {
-                       $d = date_create( 'now', $cachedTimezone );
-               }
+               $d = date_create( 'now', $cachedTimezone );
                $date = $d->format( 'D M j G:i:s T Y' );
 
                $host = wfHostname();