FANDOM's WikiaLogger -> MW's LoggerFactory

This commit is contained in:
Luqgreg 2018-07-24 15:56:43 +02:00
parent 64ad582892
commit 31ae3773cd
4 changed files with 10 additions and 8 deletions

View file

@ -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;
}

View file

@ -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' );
}
}

View file

@ -1,7 +1,7 @@
<?php
namespace Wikia\PortableInfobox\Parser;
use Wikia\Logger\WikiaLogger;
use MediaWiki\Logger\LoggerFactory;
class XmlParser {
protected static $contentTags = [ 'default', 'label', 'format', 'navigation', 'header' ];
@ -34,7 +34,7 @@ class XmlParser {
}
protected static function logXmlParseError( $level, $code, $message ) {
WikiaLogger::instance()->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 ] );

View file

@ -1,6 +1,6 @@
<?php
use Wikia\Logger\WikiaLogger;
use MediaWiki\Logger\LoggerFactory;
abstract class NodeSanitizer implements NodeTypeSanitizerInterface {
private $rootNodeTag = 'body';
@ -32,8 +32,8 @@ abstract class NodeSanitizer implements NodeTypeSanitizerInterface {
$elementTextAfterTrim = trim( $this->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