From 31ae3773cd959d5d28c409fcc1f9fd155ab1ae21 Mon Sep 17 00:00:00 2001 From: Luqgreg Date: Tue, 24 Jul 2018 15:56:43 +0200 Subject: [PATCH] FANDOM's WikiaLogger -> MW's LoggerFactory --- services/Helpers/PortableInfoboxMustacheEngine.php | 4 ++-- services/Helpers/PortableInfoboxParsingHelper.php | 4 +++- services/Parser/XmlParser.php | 4 ++-- services/Sanitizers/NodeSanitizer.php | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/services/Helpers/PortableInfoboxMustacheEngine.php b/services/Helpers/PortableInfoboxMustacheEngine.php index 2506a44..54af097 100644 --- a/services/Helpers/PortableInfoboxMustacheEngine.php +++ b/services/Helpers/PortableInfoboxMustacheEngine.php @@ -2,7 +2,7 @@ namespace Wikia\PortableInfobox\Helpers; -use Wikia\Logger\WikiaLogger; +use MediaWiki\Logger\LoggerFactory; use Wikia\Template\MustacheEngine; class PortableInfoboxMustacheEngine { @@ -57,7 +57,7 @@ class PortableInfoboxMustacheEngine { public static function isSupportedType( $type ) { $result = isset( static::$templates[ $type ] ); if ( !$result ) { - WikiaLogger::instance()->info( self::TYPE_NOT_SUPPORTED_MESSAGE, [ 'type' => $type ] ); + LoggerFactory::getInstance( 'PortableInfobox' )->info( self::TYPE_NOT_SUPPORTED_MESSAGE, [ 'type' => $type ] ); } return $result; } diff --git a/services/Helpers/PortableInfoboxParsingHelper.php b/services/Helpers/PortableInfoboxParsingHelper.php index 1d57f6b..e7ba1e5 100644 --- a/services/Helpers/PortableInfoboxParsingHelper.php +++ b/services/Helpers/PortableInfoboxParsingHelper.php @@ -2,6 +2,8 @@ namespace Wikia\PortableInfobox\Helpers; +use MediaWiki\Logger\LoggerFactory; + class PortableInfoboxParsingHelper { /** @@ -30,7 +32,7 @@ class PortableInfoboxParsingHelper { try { \PortableInfoboxParserTagController::getInstance()->render( $infobox, $parser, $frame ); } catch ( \Exception $e ) { - \Wikia\Logger\WikiaLogger::instance()->info( 'Invalid infobox syntax in includeonly tag' ); + LoggerFactory::getInstance( 'PortableInfobox' )->info( 'Invalid infobox syntax in includeonly tag' ); } } diff --git a/services/Parser/XmlParser.php b/services/Parser/XmlParser.php index 981d03e..d8fe229 100644 --- a/services/Parser/XmlParser.php +++ b/services/Parser/XmlParser.php @@ -1,7 +1,7 @@ info( "PortableInfobox XML Parser problem", [ + LoggerFactory::getInstance( 'PortableInfobox' )->info( 'PortableInfobox XML Parser problem: [ level: "{level}", code: "{code}", message: "{message}" ]', [ "level" => $level, "code" => $code, "message" => $message ] ); diff --git a/services/Sanitizers/NodeSanitizer.php b/services/Sanitizers/NodeSanitizer.php index 2b27afa..de4ca46 100644 --- a/services/Sanitizers/NodeSanitizer.php +++ b/services/Sanitizers/NodeSanitizer.php @@ -1,6 +1,6 @@ cleanUpDOM( $dom ) ); if ( $elementTextAfterTrim !== $elementText ) { - WikiaLogger::instance()->info( - 'Stripping HTML tags from infobox element', + LoggerFactory::getInstance( 'PortableInfobox' )->info( + 'Stripping HTML tags from infobox element: [ originalText: "{originalText}", trimmedText: "{trimmedText}" ]', [ 'originalText' => $elementText, 'trimmedText' => $elementTextAfterTrim