Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/migrate/src/MigrateMessage.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\migrate; | |
4 | |
5 use Drupal\Core\Logger\RfcLogLevel; | |
6 | |
7 /** | |
8 * Defines a migrate message class. | |
9 */ | |
10 class MigrateMessage implements MigrateMessageInterface { | |
11 | |
12 /** | |
13 * The map between migrate status and watchdog severity. | |
14 * | |
15 * @var array | |
16 */ | |
17 protected $map = [ | |
18 'status' => RfcLogLevel::INFO, | |
19 'error' => RfcLogLevel::ERROR, | |
20 ]; | |
21 | |
22 /** | |
23 * {@inheritdoc} | |
24 */ | |
25 public function display($message, $type = 'status') { | |
26 $type = isset($this->map[$type]) ? $this->map[$type] : RfcLogLevel::NOTICE; | |
27 \Drupal::logger('migrate')->log($type, $message); | |
28 } | |
29 | |
30 } |