MigrateMessage.php 591 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Drupal\migrate;
  3. use Drupal\Core\Logger\RfcLogLevel;
  4. /**
  5. * Defines a migrate message class.
  6. */
  7. class MigrateMessage implements MigrateMessageInterface {
  8. /**
  9. * The map between migrate status and watchdog severity.
  10. *
  11. * @var array
  12. */
  13. protected $map = [
  14. 'status' => RfcLogLevel::INFO,
  15. 'error' => RfcLogLevel::ERROR,
  16. ];
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function display($message, $type = 'status') {
  21. $type = isset($this->map[$type]) ? $this->map[$type] : RfcLogLevel::NOTICE;
  22. \Drupal::logger('migrate')->log($type, $message);
  23. }
  24. }