You are here

protected function FeedsProcessor::createLogEntry in Feeds 7.2

Creates a log entry for when an exception occurred during import.

Parameters

Exception $e: The exception that was throwned during processing the item.

object $entity: The entity object.

array $item: The parser result for this entity.

Return value

array The message and arguments to log.

1 call to FeedsProcessor::createLogEntry()
FeedsProcessor::process in plugins/FeedsProcessor.inc
Process the result of the parsing stage.

File

plugins/FeedsProcessor.inc, line 1449
Contains FeedsProcessor and related classes.

Class

FeedsProcessor
Abstract class, defines interface for processors.

Code

protected function createLogEntry(Exception $e, $entity, $item) {
  $message = '@exception';
  $message .= '<h3>Original item</h3>';
  $message .= '<pre>!item</pre>';
  $message .= '<h3>Entity</h3>';
  $message .= '<pre>!entity</pre>';
  $arguments = array(
    '@exception' => $e
      ->getMessage(),
    // $this->exportObjectVars() already runs check_plain() for us, so we can
    // use the "!" placeholder.
    '!item' => $this
      ->exportObjectVars($item),
    '!entity' => $this
      ->exportObjectVars($entity),
  );
  return array(
    $message,
    $arguments,
  );
}