From: Chad Horohoe Date: Wed, 8 Nov 2017 18:31:02 +0000 (-0800) Subject: Fix up logging grouping in ApiStashEdit X-Git-Tag: 1.31.0-rc.0~1526^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b0944a13712eb6bd02afdfde717f0cfc934b9b11;p=lhc%2Fweb%2Fwiklou.git Fix up logging grouping in ApiStashEdit Change-Id: Ie3d7b465faa26966c5745ca1bb09843a26193b9e --- diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php index 8a9de064fd..4bd6a3fb6f 100644 --- a/includes/api/ApiStashEdit.php +++ b/includes/api/ApiStashEdit.php @@ -209,8 +209,10 @@ class ApiStashEdit extends ApiBase { Hooks::run( 'ParserOutputStashForEdit', [ $page, $content, $editInfo->output, $summary, $user ] ); + $titleStr = (string)$title; if ( $alreadyCached ) { - $logger->debug( "Already cached parser output for key '$key' ('$title')." ); + $logger->debug( "Already cached parser output for key '{cachekey}' ('{title}').", + [ 'cachekey' => $key, 'title' => $titleStr ] ); return self::ERROR_NONE; } @@ -224,14 +226,17 @@ class ApiStashEdit extends ApiBase { if ( $stashInfo ) { $ok = $cache->set( $key, $stashInfo, $ttl ); if ( $ok ) { - $logger->debug( "Cached parser output for key '$key' ('$title')." ); + $logger->debug( "Cached parser output for key '{cachekey}' ('{title}').", + [ 'cachekey' => $key, 'title' => $titleStr ] ); return self::ERROR_NONE; } else { - $logger->error( "Failed to cache parser output for key '$key' ('$title')." ); + $logger->error( "Failed to cache parser output for key '{cachekey}' ('{title}').", + [ 'cachekey' => $key, 'title' => $titleStr ] ); return self::ERROR_CACHE; } } else { - $logger->info( "Uncacheable parser output for key '$key' ('$title') [$code]." ); + $logger->info( "Uncacheable parser output for key '{cachekey}' ('{title}') [{code}].", + [ 'cachekey' => $key, 'title' => $titleStr, 'code' => $code ] ); return self::ERROR_UNCACHEABLE; } }