class Drush9LogMigrateMessage in Migrate Tools 8.4
Same name and namespace in other branches
- 8.5 src/Drush9LogMigrateMessage.php \Drupal\migrate_tools\Drush9LogMigrateMessage
Print message in drush from migrate message. Drush 9 version.
@package Drupal\migrate_tools
Hierarchy
- class \Drupal\migrate_tools\Drush9LogMigrateMessage implements \Psr\Log\LoggerAwareInterface, MigrateMessageInterface uses \Psr\Log\LoggerAwareTrait
Expanded class hierarchy of Drush9LogMigrateMessage
1 file declares its use of Drush9LogMigrateMessage
- MigrateToolsCommands.php in src/
Commands/ MigrateToolsCommands.php
File
- src/
Drush9LogMigrateMessage.php, line 15
Namespace
Drupal\migrate_toolsView source
class Drush9LogMigrateMessage 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.
*/
public function display($message, $type = 'status') {
$type = isset($this->map[$type]) ? $this->map[$type] : $type;
$this->logger
->log($type, $message);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Drush9LogMigrateMessage:: |
protected | property | The map between migrate status and drush log levels. | |
Drush9LogMigrateMessage:: |
public | function |
Output a message from the migration. Overrides MigrateMessageInterface:: |
|
Drush9LogMigrateMessage:: |
public | function | DrushLogMigrateMessage constructor. |