aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-31 15:34:57 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-05-02 10:52:43 +0200
commite2531f8503dea904dd1cb389ca017ce7bda5ccfc (patch)
tree683918ba234959dd76e771aaae2af434b21d09fe /apps/dav/lib/CardDAV
parent49b650c4a46c76121d74c6c37c0dbfa0d8f53dbe (diff)
downloadnextcloud-server-e2531f8503dea904dd1cb389ca017ce7bda5ccfc.tar.gz
nextcloud-server-e2531f8503dea904dd1cb389ca017ce7bda5ccfc.zip
Migrate dav application from ILogger to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/dav/lib/CardDAV')
-rw-r--r--apps/dav/lib/CardDAV/PhotoCache.php18
-rw-r--r--apps/dav/lib/CardDAV/SyncService.php15
2 files changed, 13 insertions, 20 deletions
diff --git a/apps/dav/lib/CardDAV/PhotoCache.php b/apps/dav/lib/CardDAV/PhotoCache.php
index d3e4b2450d3..66391b268a6 100644
--- a/apps/dav/lib/CardDAV/PhotoCache.php
+++ b/apps/dav/lib/CardDAV/PhotoCache.php
@@ -34,7 +34,7 @@ use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
use Sabre\CardDAV\Card;
use Sabre\VObject\Document;
use Sabre\VObject\Parameter;
@@ -54,16 +54,12 @@ class PhotoCache {
/** @var IAppData */
protected $appData;
- /** @var ILogger */
- protected $logger;
+ protected LoggerInterface $logger;
/**
* PhotoCache constructor.
- *
- * @param IAppData $appData
- * @param ILogger $logger
*/
- public function __construct(IAppData $appData, ILogger $logger) {
+ public function __construct(IAppData $appData, LoggerInterface $logger) {
$this->appData = $appData;
$this->logger = $logger;
}
@@ -216,8 +212,8 @@ class PhotoCache {
$vObject = $this->readCard($node->get());
return $this->getPhotoFromVObject($vObject);
} catch (\Exception $e) {
- $this->logger->logException($e, [
- 'message' => 'Exception during vcard photo parsing'
+ $this->logger->error('Exception during vcard photo parsing', [
+ 'exception' => $e
]);
}
return false;
@@ -262,8 +258,8 @@ class PhotoCache {
'body' => $val
];
} catch (\Exception $e) {
- $this->logger->logException($e, [
- 'message' => 'Exception during vcard photo parsing'
+ $this->logger->error('Exception during vcard photo parsing', [
+ 'exception' => $e
]);
}
return false;
diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php
index 73bfaf01b60..b93fd94f741 100644
--- a/apps/dav/lib/CardDAV/SyncService.php
+++ b/apps/dav/lib/CardDAV/SyncService.php
@@ -30,9 +30,9 @@ namespace OCA\DAV\CardDAV;
use OC\Accounts\AccountManager;
use OCP\AppFramework\Http;
-use OCP\ILogger;
use OCP\IUser;
use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
use Sabre\DAV\Client;
use Sabre\DAV\Xml\Response\MultiStatus;
use Sabre\DAV\Xml\Service;
@@ -47,8 +47,7 @@ class SyncService {
/** @var IUserManager */
private $userManager;
- /** @var ILogger */
- private $logger;
+ private LoggerInterface $logger;
/** @var array */
private $localSystemAddressBook;
@@ -61,13 +60,11 @@ class SyncService {
/**
* SyncService constructor.
- *
- * @param CardDavBackend $backend
- * @param IUserManager $userManager
- * @param ILogger $logger
- * @param AccountManager $accountManager
*/
- public function __construct(CardDavBackend $backend, IUserManager $userManager, ILogger $logger, Converter $converter) {
+ public function __construct(CardDavBackend $backend,
+ IUserManager $userManager,
+ LoggerInterface $logger,
+ Converter $converter) {
$this->backend = $backend;
$this->userManager = $userManager;
$this->logger = $logger;