diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-03-29 10:39:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 10:39:38 +0300 |
commit | 765999f454c0c5ebd8f2aa693d123f62d104d37a (patch) | |
tree | ee986c4dcb0edac3babb7ee87e5afc159087e2e0 /apps/files_external | |
parent | 4a4f250a2b733f915e8b465bc995ea8ac18a8fbc (diff) | |
parent | 6d354595f71f15f3d15bce70683b4bc013a6bfaf (diff) |
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
Migrate from ILogger to LoggerInterface in lib/private
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; |