From: Timo Tijhof Date: Thu, 4 Oct 2018 18:54:36 +0000 (+0100) Subject: filebackend: Add normalization for stat errors X-Git-Tag: 1.34.0-rc.0~3884^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=8df0342eef3104dbb78f157d7a41965c4ce632df;p=lhc%2Fweb%2Fwiklou.git filebackend: Add normalization for stat errors Bug: T205567 Change-Id: I75f1eb6dc2cbff0ea0dc0706cca0ad79c54fc612 --- 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, + ] ); } }