From b0944a13712eb6bd02afdfde717f0cfc934b9b11 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 8 Nov 2017 10:31:02 -0800 Subject: [PATCH] Fix up logging grouping in ApiStashEdit Change-Id: Ie3d7b465faa26966c5745ca1bb09843a26193b9e --- includes/api/ApiStashEdit.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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; } } -- 2.20.1