From 8df0342eef3104dbb78f157d7a41965c4ce632df Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 4 Oct 2018 19:54:36 +0100 Subject: [PATCH] filebackend: Add normalization for stat errors Bug: T205567 Change-Id: I75f1eb6dc2cbff0ea0dc0706cca0ad79c54fc612 --- includes/libs/filebackend/FileBackendStore.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/includes/libs/filebackend/FileBackendStore.php b/includes/libs/filebackend/FileBackendStore.php index e2d56b0a54..0403725d54 100644 --- a/includes/libs/filebackend/FileBackendStore.php +++ b/includes/libs/filebackend/FileBackendStore.php @@ -663,9 +663,13 @@ abstract class FileBackendStore extends FileBackend { $this->cheapCache->setField( $path, 'stat', $latest ? 'NOT_EXIST_LATEST' : 'NOT_EXIST' ); $this->cheapCache->setField( $path, 'xattr', [ 'map' => false, 'latest' => $latest ] ); $this->cheapCache->setField( $path, 'sha1', [ 'hash' => false, 'latest' => $latest ] ); - $this->logger->debug( __METHOD__ . ": File $path does not exist.\n" ); + $this->logger->debug( __METHOD__ . ': File {path} does not exist', [ + 'path' => $path, + ] ); } else { // an error occurred - $this->logger->warning( __METHOD__ . ": Could not stat file $path.\n" ); + $this->logger->warning( __METHOD__ . ': Could not stat file {path}', [ + 'path' => $path, + ] ); } return $stat; @@ -1341,10 +1345,14 @@ abstract class FileBackendStore extends FileBackend { [ 'map' => false, 'latest' => $latest ] ); $this->cheapCache->setField( $path, 'sha1', [ 'hash' => false, 'latest' => $latest ] ); - $this->logger->debug( __METHOD__ . ": File $path does not exist.\n" ); + $this->logger->debug( __METHOD__ . ': File {path} does not exist', [ + 'path' => $path, + ] ); } else { // an error occurred $success = false; - $this->logger->warning( __METHOD__ . ": Could not stat file $path.\n" ); + $this->logger->warning( __METHOD__ . ': Could not stat file {path}', [ + 'path' => $path, + ] ); } } -- 2.20.1