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 "Check for valid user info before calling Linker::userLink() in Linker::revUser...
[lhc/web/wiklou.git]
/
includes
/
debug
/
logger
/
LegacyLogger.php
diff --git
a/includes/debug/logger/LegacyLogger.php
b/includes/debug/logger/LegacyLogger.php
index
6288a50
..
72c7643
100644
(file)
--- a/
includes/debug/logger/LegacyLogger.php
+++ b/
includes/debug/logger/LegacyLogger.php
@@
-21,12
+21,14
@@
namespace MediaWiki\Logger;
use DateTimeZone;
namespace MediaWiki\Logger;
use DateTimeZone;
+use Error;
use Exception;
use WikiMap;
use MWDebug;
use MWExceptionHandler;
use Psr\Log\AbstractLogger;
use Psr\Log\LogLevel;
use Exception;
use WikiMap;
use MWDebug;
use MWExceptionHandler;
use Psr\Log\AbstractLogger;
use Psr\Log\LogLevel;
+use Throwable;
use UDPTransport;
/**
use UDPTransport;
/**
@@
-269,7
+271,7
@@
class LegacyLogger extends AbstractLogger {
$e = $context['exception'];
$backtrace = false;
$e = $context['exception'];
$backtrace = false;
- if ( $e instanceof Exception ) {
+ if ( $e instanceof
Throwable || $e instanceof
Exception ) {
$backtrace = MWExceptionHandler::getRedactedTrace( $e );
} elseif ( is_array( $e ) && isset( $e['trace'] ) ) {
$backtrace = MWExceptionHandler::getRedactedTrace( $e );
} elseif ( is_array( $e ) && isset( $e['trace'] ) ) {
@@
-327,7
+329,7
@@
class LegacyLogger extends AbstractLogger {
$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();
- $wiki = WikiMap::getWikiIdFromD
omain( WikiMap::getCurrentWiki
Domain() );
+ $wiki = WikiMap::getWikiIdFromD
bDomain( WikiMap::getCurrentWikiDb
Domain() );
$text = "{$date}\t{$host}\t{$wiki}\t{$message}\n";
return $text;
$text = "{$date}\t{$host}\t{$wiki}\t{$message}\n";
return $text;
@@
-343,7
+345,7
@@
class LegacyLogger extends AbstractLogger {
*/
protected static function formatAsWfDebugLog( $channel, $message, $context ) {
$time = wfTimestamp( TS_DB );
*/
protected static function formatAsWfDebugLog( $channel, $message, $context ) {
$time = wfTimestamp( TS_DB );
- $wiki = WikiMap::getWikiIdFromD
omain( WikiMap::getCurrentWiki
Domain() );
+ $wiki = WikiMap::getWikiIdFromD
bDomain( WikiMap::getCurrentWikiDb
Domain() );
$host = wfHostname();
$text = "{$time} {$host} {$wiki}: {$message}\n";
return $text;
$host = wfHostname();
$text = "{$time} {$host} {$wiki}: {$message}\n";
return $text;
@@
-375,7
+377,7
@@
class LegacyLogger extends AbstractLogger {
* @return string
*/
protected static function flatten( $item ) {
* @return string
*/
protected static function flatten( $item ) {
- if (
null === $item
) {
+ if (
$item === null
) {
return '[Null]';
}
return '[Null]';
}
@@
-405,8
+407,9
@@
class LegacyLogger extends AbstractLogger {
return $item->format( 'c' );
}
return $item->format( 'c' );
}
- if ( $item instanceof Exception ) {
- return '[Exception ' . get_class( $item ) . '( ' .
+ if ( $item instanceof Throwable || $item instanceof Exception ) {
+ $which = $item instanceof Error ? 'Error' : 'Exception';
+ return '[' . $which . ' ' . get_class( $item ) . '( ' .
$item->getFile() . ':' . $item->getLine() . ') ' .
$item->getMessage() . ']';
}
$item->getFile() . ':' . $item->getLine() . ') ' .
$item->getMessage() . ']';
}