dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Make change tagging of edits in RecentChange::notifyNew/Edit"
[lhc/web/wiklou.git]
/
includes
/
debug
/
logger
/
LegacyLogger.php
diff --git
a/includes/debug/logger/LegacyLogger.php
b/includes/debug/logger/LegacyLogger.php
index
bb3c7e1
..
23c3102
100644
(file)
--- a/
includes/debug/logger/LegacyLogger.php
+++ b/
includes/debug/logger/LegacyLogger.php
@@
-41,7
+41,7
@@
use UDPTransport;
* See documentation in DefaultSettings.php for detailed explanations of each
* variable.
*
* See documentation in DefaultSettings.php for detailed explanations of each
* variable.
*
- * @see \
\MediaWiki\\Logger\
\LoggerFactory
+ * @see \
MediaWiki\Logger
\LoggerFactory
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@
-54,7
+54,7
@@
class LegacyLogger extends AbstractLogger {
protected $channel;
/**
protected $channel;
/**
- * Convert
Psr\\Log\
\LogLevel constants into int for sane comparisons
+ * Convert
\Psr\Log
\LogLevel constants into int for sane comparisons
* These are the same values that Monlog uses
*
* @var array $levelMapping
* These are the same values that Monlog uses
*
* @var array $levelMapping
@@
-70,7
+70,6
@@
class LegacyLogger extends AbstractLogger {
LogLevel::EMERGENCY => 600,
);
LogLevel::EMERGENCY => 600,
);
-
/**
* @param string $channel
*/
/**
* @param string $channel
*/
@@
-91,17
+90,18
@@
class LegacyLogger extends AbstractLogger {
$destination = self::destination( $this->channel, $message, $context );
self::emit( $text, $destination );
}
$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.
*
* @param string $channel
* @param string $message
/**
* Determine if the given message should be emitted or not.
*
* @param string $channel
* @param string $message
- * @param string|int $level
Psr\\Log\
\LogEvent constant or Monlog level int
+ * @param string|int $level
\Psr\Log
\LogEvent constant or Monlog level int
* @param array $context
* @return bool True if message should be sent to disk/network, false
* otherwise
* @param array $context
* @return bool True if message should be sent to disk/network, false
* otherwise
@@
-118,6
+118,13
@@
class LegacyLogger extends AbstractLogger {
// All messages on the wfErrorLog channel should be emitted.
$shouldEmit = true;
// 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];
} elseif ( isset( $wgDebugLogGroups[$channel] ) ) {
$logConfig = $wgDebugLogGroups[$channel];
@@
-154,7
+161,6
@@
class LegacyLogger extends AbstractLogger {
return $shouldEmit;
}
return $shouldEmit;
}
-
/**
* Format a message.
*
/**
* Format a message.
*
@@
-239,7
+245,6
@@
class LegacyLogger extends AbstractLogger {
return self::interpolate( $text, $context );
}
return self::interpolate( $text, $context );
}
-
/**
* Format a message as `wfDebug()` would have formatted it.
*
/**
* Format a message as `wfDebug()` would have formatted it.
*
@@
-261,7
+266,6
@@
class LegacyLogger extends AbstractLogger {
return "{$text}\n";
}
return "{$text}\n";
}
-
/**
* Format a message as `wfLogDBError()` would have formatted it.
*
/**
* Format a message as `wfLogDBError()` would have formatted it.
*
@@
-278,13
+282,7
@@
class LegacyLogger extends AbstractLogger {
$cachedTimezone = new DateTimeZone( $wgDBerrorLogTZ );
}
$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();
$date = $d->format( 'D M j G:i:s T Y' );
$host = wfHostname();
@@
-294,7
+292,6
@@
class LegacyLogger extends AbstractLogger {
return $text;
}
return $text;
}
-
/**
* Format a message as `wfDebugLog() would have formatted it.
*
/**
* Format a message as `wfDebugLog() would have formatted it.
*
@@
-310,7
+307,6
@@
class LegacyLogger extends AbstractLogger {
return $text;
}
return $text;
}
-
/**
* Interpolate placeholders in logging message.
*
/**
* Interpolate placeholders in logging message.
*
@@
-329,7
+325,6
@@
class LegacyLogger extends AbstractLogger {
return $message;
}
return $message;
}
-
/**
* Convert a logging context element to a string suitable for
* interpolation.
/**
* Convert a logging context element to a string suitable for
* interpolation.
@@
-389,7
+384,6
@@
class LegacyLogger extends AbstractLogger {
return '[Unknown ' . gettype( $item ) . ']';
}
return '[Unknown ' . gettype( $item ) . ']';
}
-
/**
* Select the appropriate log output destination for the given log event.
*
/**
* Select the appropriate log output destination for the given log event.
*
@@
-430,7
+424,6
@@
class LegacyLogger extends AbstractLogger {
return $destination;
}
return $destination;
}
-
/**
* Log to a file without getting "file size exceeded" signals.
*
/**
* Log to a file without getting "file size exceeded" signals.
*