Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-07-16 20:36:59 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-07-16 20:38:20 +0300
commitb3b856c9db38eb58e48490745f587ba01fa10a34 (patch)
treef0e8021b4c0d85023144d175552ec7489f3977a6 /apps/contactsinteraction
parent8a433a72264345d734b0f8f40e5d57b9370e6751 (diff)
Migrate contacts interaction to the PSR-3 logger
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/contactsinteraction')
-rw-r--r--apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php
index 2c1aced82e1..4bcc13a97a6 100644
--- a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php
+++ b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php
@@ -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 {