You are here

public function WatchdogLogger::catchMessages in Ultimate Cron 8.2

Begin capturing messages.

Parameters

LogEntry $log_entry: The log entry that should capture messages.

File

src/Logger/WatchdogLogger.php, line 76

Class

WatchdogLogger
Logs events in currently running cronjobs.

Namespace

Drupal\ultimate_cron\Logger

Code

public function catchMessages(LogEntry $log_entry) {

  // Since we may already be inside a drupal_register_shutdown_function()
  // we cannot use that. Use PHPs register_shutdown_function() instead.
  if (!$this->shutdownRegistered) {
    ultimate_cron_register_shutdown_function(array(
      $this,
      'catchMessagesShutdownWrapper',
    ), 'catch_messages');
    $this->shutdownRegistered = TRUE;
  }
  $this->logEntries[$log_entry->lid] = $log_entry;
}