X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdebug%2Flogger%2FLegacyLogger.php;h=72c76434185e90079e2fd31c7b5ccb4f420c0e62;hb=b7e71525df3d401e3fd1e4815413610c65282465;hp=bbcd33ac753895e646709d8cc41551b513cec2b5;hpb=28c6ce84c39ab99673cfd4da04c0a6b5a516405c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/debug/logger/LegacyLogger.php b/includes/debug/logger/LegacyLogger.php index bbcd33ac75..72c7643418 100644 --- a/includes/debug/logger/LegacyLogger.php +++ b/includes/debug/logger/LegacyLogger.php @@ -21,12 +21,14 @@ namespace MediaWiki\Logger; use DateTimeZone; +use Error; use Exception; use WikiMap; use MWDebug; use MWExceptionHandler; use Psr\Log\AbstractLogger; use Psr\Log\LogLevel; +use Throwable; use UDPTransport; /** @@ -269,7 +271,7 @@ class LegacyLogger extends AbstractLogger { $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'] ) ) { @@ -405,8 +407,9 @@ class LegacyLogger extends AbstractLogger { 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() . ']'; }