diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-17 19:26:27 +0300 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-24 18:21:25 +0300 |
commit | ea23523c70ee562092510ccf88e7aa469aae9ce6 (patch) | |
tree | da0ce15036d2f7b82ef1a0e44adb497c8e951cb3 /apps/files_external | |
parent | eb961e47003ee5b6d7328caf10ecd5f53cc93666 (diff) |
Adapt more code to migration to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/Swift.php | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index 17859259fe3..fb93c6cdce2 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -48,9 +48,9 @@ use Icewind\Streams\IteratorDirectory; use OC\Files\ObjectStore\SwiftFactory; use OCP\Files\IMimeTypeDetector; use OCP\Files\StorageBadConfigException; -use OCP\ILogger; use OpenStack\Common\Error\BadResponseError; use OpenStack\ObjectStore\v1\Models\StorageObject; +use Psr\Log\LoggerInterface; class Swift extends \OC\Files\Storage\Common { /** @var SwiftFactory */ @@ -138,8 +138,8 @@ class Swift extends \OC\Files\Storage\Common { } catch (BadResponseError $e) { // Expected response is "404 Not Found", so only log if it isn't if ($e->getResponse()->getStatusCode() !== 404) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); } @@ -204,7 +204,7 @@ class Swift extends \OC\Files\Storage\Common { $this->connectionFactory = new SwiftFactory( \OC::$server->getMemCacheFactory()->createDistributed('swift/'), $this->params, - \OC::$server->getLogger() + \OC::$server->get(LoggerInterface::class) ); $this->objectStore = new \OC\Files\ObjectStore\Swift($this->params, $this->connectionFactory); $this->bucket = $params['bucket']; @@ -232,8 +232,8 @@ class Swift extends \OC\Files\Storage\Common { // with all properties $this->objectCache->remove($path); } catch (BadResponseError $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; @@ -276,8 +276,8 @@ class Swift extends \OC\Files\Storage\Common { $this->objectStore->deleteObject($path . '/'); $this->objectCache->remove($path . '/'); } catch (BadResponseError $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; @@ -314,8 +314,8 @@ class Swift extends \OC\Files\Storage\Common { return IteratorDirectory::wrap($files); } catch (\Exception $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; @@ -337,8 +337,8 @@ class Swift extends \OC\Files\Storage\Common { return false; } } catch (BadResponseError $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; @@ -391,8 +391,8 @@ class Swift extends \OC\Files\Storage\Common { $this->objectCache->remove($path . '/'); } catch (BadResponseError $e) { if ($e->getResponse()->getStatusCode() !== 404) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); throw $e; @@ -415,8 +415,8 @@ class Swift extends \OC\Files\Storage\Common { try { return $this->objectStore->readObject($path); } catch (BadResponseError $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; @@ -502,8 +502,8 @@ class Swift extends \OC\Files\Storage\Common { $this->objectCache->remove($path2); $this->objectCache->remove($path2 . '/'); } catch (BadResponseError $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; @@ -518,8 +518,8 @@ class Swift extends \OC\Files\Storage\Common { $this->objectCache->remove($path2); $this->objectCache->remove($path2 . '/'); } catch (BadResponseError $e) { - \OC::$server->getLogger()->logException($e, [ - 'level' => ILogger::ERROR, + \OC::$server->get(LoggerInterface::class)->error($e->getMessage(), [ + 'exception' => $e, 'app' => 'files_external', ]); return false; |