Migrate contacts interaction to the PSR-3 logger
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
8a433a7226
commit
b3b856c9db
|
@ -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,9 +125,10 @@ 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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue