From: Aaron Schulz Date: Thu, 4 Jul 2019 19:51:09 +0000 (-0700) Subject: Import the PSR logger classes in Message X-Git-Tag: 1.34.0-rc.0~1159^2 X-Git-Url: http://git.cyclocoop.org/%22.htmlspecialchars%28%24url_syndic%29.%22?a=commitdiff_plain;h=c21fec141b079efa38f7544ff1b85b66d43ce902;p=lhc%2Fweb%2Fwiklou.git Import the PSR logger classes in Message Change-Id: If05db9b55275246174b6f1fd0ca8437f271f5eea --- diff --git a/includes/language/Message.php b/includes/language/Message.php index 0b3113f29c..12007faf87 100644 --- a/includes/language/Message.php +++ b/includes/language/Message.php @@ -20,6 +20,8 @@ * @file * @author Niklas Laxström */ + +use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; /** @@ -856,7 +858,7 @@ class Message implements MessageSpecifier, Serializable { public function toString( $format = null ) { if ( $format === null ) { $ex = new LogicException( __METHOD__ . ' using implicit format: ' . $this->format ); - \MediaWiki\Logger\LoggerFactory::getInstance( 'message-format' )->warning( + LoggerFactory::getInstance( 'message-format' )->warning( $ex->getMessage(), [ 'exception' => $ex, 'format' => $this->format, 'key' => $this->key ] ); $format = $this->format; } @@ -1206,7 +1208,7 @@ class Message implements MessageSpecifier, Serializable { if ( !is_scalar( $param ) ) { $param = serialize( $param ); } - \MediaWiki\Logger\LoggerFactory::getInstance( 'Bug58676' )->warning( + LoggerFactory::getInstance( 'Bug58676' )->warning( 'Invalid parameter for message "{msgkey}": {param}', [ 'exception' => new Exception,