diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-03-29 09:39:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 09:39:38 +0200 |
commit | 765999f454c0c5ebd8f2aa693d123f62d104d37a (patch) | |
tree | ee986c4dcb0edac3babb7ee87e5afc159087e2e0 /lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php | |
parent | 4a4f250a2b733f915e8b465bc995ea8ac18a8fbc (diff) | |
parent | 6d354595f71f15f3d15bce70683b4bc013a6bfaf (diff) | |
download | nextcloud-server-765999f454c0c5ebd8f2aa693d123f62d104d37a.tar.gz nextcloud-server-765999f454c0c5ebd8f2aa693d123f62d104d37a.zip |
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
Migrate from ILogger to LoggerInterface in lib/private
Diffstat (limited to 'lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php')
-rw-r--r-- | lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php b/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php index 39b48562791..25dc24fb66c 100644 --- a/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php +++ b/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php @@ -30,9 +30,9 @@ use OCP\Files\IAppData; use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\IConfig; -use OCP\ILogger; use OCP\Migration\IOutput; use OCP\Migration\IRepairStep; +use Psr\Log\LoggerInterface; use RuntimeException; /** @@ -52,10 +52,9 @@ class CleanupCardDAVPhotoCache implements IRepairStep { /** @var IAppData */ private $appData; - /** @var ILogger */ - private $logger; + private LoggerInterface $logger; - public function __construct(IConfig $config, IAppData $appData, ILogger $logger) { + public function __construct(IConfig $config, IAppData $appData, LoggerInterface $logger) { $this->config = $config; $this->appData = $appData; $this->logger = $logger; @@ -71,7 +70,7 @@ class CleanupCardDAVPhotoCache implements IRepairStep { } catch (NotFoundException $e) { return; } catch (RuntimeException $e) { - $this->logger->logException($e, ['message' => 'Failed to fetch directory listing in CleanupCardDAVPhotoCache']); + $this->logger->error('Failed to fetch directory listing in CleanupCardDAVPhotoCache', ['exception' => $e]); return; } @@ -90,7 +89,7 @@ class CleanupCardDAVPhotoCache implements IRepairStep { /** @var ISimpleFolder $folder */ $folder->getFile('photo.')->delete(); } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->error($e->getMessage(), ['exception' => $e]); $output->warning('Could not delete file "dav-photocache/' . $folder->getName() . '/photo."'); } } |