14 use Psr\Log\LoggerInterface;
24 private $productMetadata;
29 private $notificationLogger;
47 NotificationLogger $notificationLogger,
48 LoggerInterface $logger
50 parent::__construct($context);
51 $this->productMetadata = $productMetadata;
52 $this->notificationLogger = $notificationLogger;
65 'success' => $this->notificationLogger->log(
66 $this->_auth->getUser()->getId(),
67 $this->productMetadata->getVersion()
72 $this->logger->error($e->getMessage());
75 'error_message' => $e->getMessage()
77 }
catch (\Exception $e) {
78 $this->logger->error($e->getMessage());
81 'error_message' =>
__(
'It is impossible to log user action')
85 return $resultJson->setData($responseContent);
93 return parent::_isAllowed();
__construct(Action\Context $context, ProductMetadataInterface $productMetadata, NotificationLogger $notificationLogger, LoggerInterface $logger)