/**
  * {@inheritdoc}
  */
 public function log($level, $message, array $context = array())
 {
     if ($this->context && in_array($level, [LogLevel::EMERGENCY, LogLevel::ALERT, LogLevel::CRITICAL, LogLevel::ERROR])) {
         $this->context->addError($message);
     }
     return parent::log($level, $message, $context);
 }
 /**
  * @param array $validationErrors
  * @param ContextInterface $context
  * @param string|null $errorPrefix
  */
 public function addValidationErrors(array $validationErrors, ContextInterface $context, $errorPrefix = null)
 {
     if (null === $errorPrefix) {
         $errorPrefix = $this->translator->trans('oro.importexport.import_error %number%', array('%number%' => $context->getReadOffset()));
     }
     foreach ($validationErrors as $validationError) {
         $context->addError($errorPrefix . ' ' . $validationError);
     }
 }