class DrushLogMigrateMessage in Migrate Upgrade 8.3
Same name and namespace in other branches
- 8 src/DrushLogMigrateMessage.php \Drupal\migrate_upgrade\DrushLogMigrateMessage
- 8.2 src/DrushLogMigrateMessage.php \Drupal\migrate_upgrade\DrushLogMigrateMessage
Class DrushLogMigrateMessage.
@package Drupal\migrate_upgrade
Hierarchy
- class \Drupal\migrate_upgrade\DrushLogMigrateMessage implements \Psr\Log\LoggerAwareInterface, MigrateMessageInterface uses \Psr\Log\LoggerAwareTrait
Expanded class hierarchy of DrushLogMigrateMessage
File
- src/
DrushLogMigrateMessage.php, line 16
Namespace
Drupal\migrate_upgradeView source
class DrushLogMigrateMessage implements MigrateMessageInterface, LoggerAwareInterface {
use LoggerAwareTrait;
/**
* The map between migrate status and drush log levels.
*
* @var array
*/
protected $map = [
'status' => 'notice',
];
/**
* DrushLogMigrateMessage constructor.
*/
public function __construct(LoggerInterface $logger) {
$this
->setLogger($logger);
}
/**
* Output a message from the migration.
*
* @param string $message
* The message to display.
* @param string $type
* The type of message to display.
*
* @see drush_log()
*/
public function display($message, $type = 'status') {
$type = isset($this->map[$type]) ? $this->map[$type] : RfcLogLevel::NOTICE;
\Drupal::service('logger.channel.migrate_upgrade')
->log($type, $message);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrushLogMigrateMessage:: |
protected | property | The map between migrate status and drush log levels. | |
DrushLogMigrateMessage:: |
public | function |
Output a message from the migration. Overrides MigrateMessageInterface:: |
|
DrushLogMigrateMessage:: |
public | function | DrushLogMigrateMessage constructor. |