From: Timo Tijhof Date: Wed, 26 Aug 2015 18:41:03 +0000 (+0200) Subject: poolcounter: Convert slow-parse to LoggerFactory with data context X-Git-Tag: 1.31.0-rc.0~10262^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=8c74b8a3e8308d80d7697e415f22f5da8994f2f5;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) {