Migrate contacts interaction to the PSR-3 logger

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2020-07-16 19:36:59 +02:00
parent 8a433a7226
commit b3b856c9db
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
1 changed files with 8 additions and 7 deletions

View 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 {