diff options
Diffstat (limited to 'lib/private/Files/Storage/Wrapper/Encryption.php')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encryption.php | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 75611d1ab0f..a03dd0ba441 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -50,7 +50,7 @@ use OCP\Encryption\Keys\IStorage; use OCP\Files\Cache\ICacheEntry; use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage; -use OCP\ILogger; +use Psr\Log\LoggerInterface; class Encryption extends Wrapper { use LocalTempFileTrait; @@ -64,8 +64,7 @@ class Encryption extends Wrapper { /** @var \OCP\Encryption\IManager */ private $encryptionManager; - /** @var \OCP\ILogger */ - private $logger; + private LoggerInterface $logger; /** @var string */ private $uid; @@ -96,27 +95,18 @@ class Encryption extends Wrapper { /** * @param array $parameters - * @param IManager $encryptionManager - * @param Util $util - * @param ILogger $logger - * @param IFile $fileHelper - * @param string $uid - * @param IStorage $keyStorage - * @param Update $update - * @param Manager $mountManager - * @param ArrayCache $arrayCache */ public function __construct( $parameters, - IManager $encryptionManager = null, - Util $util = null, - ILogger $logger = null, - IFile $fileHelper = null, - $uid = null, - IStorage $keyStorage = null, - Update $update = null, - Manager $mountManager = null, - ArrayCache $arrayCache = null + IManager $encryptionManager, + Util $util, + LoggerInterface $logger, + IFile $fileHelper, + string $uid, + IStorage $keyStorage, + Update $update, + Manager $mountManager, + ArrayCache $arrayCache ) { $this->mountPoint = $parameters['mountPoint']; $this->mount = $parameters['mount']; @@ -448,9 +438,8 @@ class Encryption extends Wrapper { } } } catch (ModuleDoesNotExistsException $e) { - $this->logger->logException($e, [ - 'message' => 'Encryption module "' . $encryptionModuleId . '" not found, file will be stored unencrypted', - 'level' => ILogger::WARN, + $this->logger->warning('Encryption module "' . $encryptionModuleId . '" not found, file will be stored unencrypted', [ + 'exception' => $e, 'app' => 'core', ]); } @@ -503,8 +492,7 @@ class Encryption extends Wrapper { try { $result = $this->fixUnencryptedSize($path, $size, $unencryptedSize); } catch (\Exception $e) { - $this->logger->error('Couldn\'t re-calculate unencrypted size for ' . $path); - $this->logger->logException($e); + $this->logger->error('Couldn\'t re-calculate unencrypted size for ' . $path, ['exception' => $e]); } unset($this->fixUnencryptedSizeOf[$this->getFullPath($path)]); } |