]> source.dussan.org Git - nextcloud-server.git/commitdiff
Migrate contacts interaction to the PSR-3 logger 21875/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 16 Jul 2020 17:36:59 +0000 (19:36 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 16 Jul 2020 17:38:20 +0000 (19:38 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php

index 2c1aced82e1130c83ed1cdedae529de48ff03c6b..4bcc13a97a6efc04359e9514c7a64a74a7db4216 100644 (file)
@@ -33,8 +33,8 @@ use OCP\Contacts\Events\ContactInteractedWithEvent;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventListener;
 use OCP\IL10N;
-use OCP\ILogger;
 use OCP\IUserManager;
+use Psr\Log\LoggerInterface;
 use Sabre\VObject\Component\VCard;
 use Sabre\VObject\Reader;
 use Sabre\VObject\UUIDUtil;
@@ -57,7 +57,7 @@ class ContactInteractionListener implements IEventListener {
        /** @var IL10N */
        private $l10n;
 
-       /** @var ILogger */
+       /** @var LoggerInterface */
        private $logger;
 
        public function __construct(RecentContactMapper $mapper,
@@ -65,7 +65,7 @@ class ContactInteractionListener implements IEventListener {
                                                                IUserManager $userManager,
                                                                ITimeFactory $timeFactory,
                                                                IL10N $l10nFactory,
-                                                               ILogger $logger) {
+                                                               LoggerInterface $logger) {
                $this->mapper = $mapper;
                $this->cardSearchDao = $cardSearchDao;
                $this->userManager = $userManager;
@@ -125,10 +125,11 @@ class ContactInteractionListener implements IEventListener {
                                $parsed->CATEGORIES = $this->l10n->t('Recently contacted');
                                $contact->setCard($parsed->serialize());
                        } catch (Throwable $e) {
-                               $this->logger->logException($e, [
-                                       'message' => 'Could not parse card to add recent category: ' . $e->getMessage(),
-                                       'level' => ILogger::WARN,
-                               ]);
+                               $this->logger->warning(
+                                       'Could not parse card to add recent category: ' . $e->getMessage(),
+                                       [
+                                               'exception' => $e,
+                                       ]);
                                $contact->setCard($copy);
                        }
                } else {