From 8c74b8a3e8308d80d7697e415f22f5da8994f2f5 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 26 Aug 2015 20:41:03 +0200 Subject: [PATCH] poolcounter: Convert slow-parse to LoggerFactory with data context This way the time and title values are transmitted via Monolog as separate JSON properties. Keep the message the same for backwards-compatibility (except for the space padding). Change-Id: I0b79944bb9944dc6d09d16fe2ecc845e0e0e2afb --- includes/poolcounter/PoolWorkArticleView.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/poolcounter/PoolWorkArticleView.php b/includes/poolcounter/PoolWorkArticleView.php index a702d2e885..d601467d01 100644 --- a/includes/poolcounter/PoolWorkArticleView.php +++ b/includes/poolcounter/PoolWorkArticleView.php @@ -142,8 +142,12 @@ class PoolWorkArticleView extends PoolCounterWork { // Timing hack if ( $time > 3 ) { - wfDebugLog( 'slow-parse', sprintf( "%-5.2f %s", $time, - $this->page->getTitle()->getPrefixedDBkey() ) ); + // TODO: Use Parser's logger (once it has one) + $logger = MediaWiki\Logger\LoggerFactory::getInstance( 'slow-parse' ); + $logger->info( '{time} {title}', array( + 'time' => number_format( $time, 2 ), + 'title' => $this->page->getTitle()->getPrefixedDBkey(), + ) ); } if ( $this->cacheable && $this->parserOutput->isCacheable() && $isCurrent ) { -- 2.20.1