Merge "mw.widgets.CategorySelector: Don't lose namespace-like prefixes from category...
[lhc/web/wiklou.git] / includes / debug / logger / LegacyLogger.php
index 65719fa..34ea641 100644 (file)
@@ -70,7 +70,6 @@ class LegacyLogger extends AbstractLogger {
                LogLevel::EMERGENCY => 600,
        );
 
-
        /**
         * @param string $channel
         */
@@ -91,11 +90,12 @@ 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 );
+               }
        }
 
-
        /**
         * Determine if the given message should be emitted or not.
         *
@@ -118,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];
 
@@ -154,7 +161,6 @@ class LegacyLogger extends AbstractLogger {
                return $shouldEmit;
        }
 
-
        /**
         * Format a message.
         *
@@ -239,7 +245,6 @@ class LegacyLogger extends AbstractLogger {
                return self::interpolate( $text, $context );
        }
 
-
        /**
         * Format a message as `wfDebug()` would have formatted it.
         *
@@ -261,7 +266,6 @@ class LegacyLogger extends AbstractLogger {
                return "{$text}\n";
        }
 
-
        /**
         * Format a message as `wfLogDBError()` would have formatted it.
         *
@@ -294,7 +298,6 @@ class LegacyLogger extends AbstractLogger {
                return $text;
        }
 
-
        /**
         * Format a message as `wfDebugLog() would have formatted it.
         *
@@ -310,7 +313,6 @@ class LegacyLogger extends AbstractLogger {
                return $text;
        }
 
-
        /**
         * Interpolate placeholders in logging message.
         *
@@ -329,7 +331,6 @@ class LegacyLogger extends AbstractLogger {
                return $message;
        }
 
-
        /**
         * Convert a logging context element to a string suitable for
         * interpolation.
@@ -389,7 +390,6 @@ class LegacyLogger extends AbstractLogger {
                return '[Unknown ' . gettype( $item ) . ']';
        }
 
-
        /**
         * Select the appropriate log output destination for the given log event.
         *
@@ -430,7 +430,6 @@ class LegacyLogger extends AbstractLogger {
                return $destination;
        }
 
-
        /**
        * Log to a file without getting "file size exceeded" signals.
        *