X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdebug%2Flogger%2FLegacyLogger.php;h=23c3102ee27eca33f2ffdd4718badb38bf0139fd;hb=df85890b76b18e0c9bc465984b63df6090955a5a;hp=ef7d81947cf67e4cadc34ab00df3d3d2de500a65;hpb=c732764ef4764c384eb9e2502ce249fb4a177bee;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/debug/logger/LegacyLogger.php b/includes/debug/logger/LegacyLogger.php index ef7d81947c..23c3102ee2 100644 --- a/includes/debug/logger/LegacyLogger.php +++ b/includes/debug/logger/LegacyLogger.php @@ -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();