function migrate_watchdog in Migrate 7.2
Same name and namespace in other branches
- 6.2 migrate.module \migrate_watchdog()
Implements hook_watchdog(). Find the migration that is currently running and notify it.
Parameters
array $log_entry:
File
- ./
migrate.module, line 450 - API and drush commands to support migration of data from external sources into a Drupal installation.
Code
function migrate_watchdog($log_entry) {
// Ensure that the Migration class exists, as different bootstrap phases may
// not have included migration.inc yet.
if (class_exists('Migration') && ($migration = Migration::currentMigration())) {
switch ($log_entry['severity']) {
case WATCHDOG_EMERGENCY:
case WATCHDOG_ALERT:
case WATCHDOG_CRITICAL:
case WATCHDOG_ERROR:
$severity = MigrationBase::MESSAGE_ERROR;
break;
case WATCHDOG_WARNING:
$severity = MigrationBase::MESSAGE_WARNING;
break;
case WATCHDOG_NOTICE:
$severity = MigrationBase::MESSAGE_NOTICE;
break;
case WATCHDOG_DEBUG:
case WATCHDOG_INFO:
default:
$severity = MigrationBase::MESSAGE_INFORMATIONAL;
break;
}
$variables = is_array($log_entry['variables']) ? $log_entry['variables'] : array();
$migration
->saveMessage(t($log_entry['message'], $variables), $severity);
}
}