You are here

function ultimate_cron_watchdog_throwable in Ultimate Cron 7.2

Logs a Throwable.

This is a copy of watchdog_exception() except that $exception is Throwable.

Parameters

$type: The category to which this message belongs.

$exception: The exception that is going to be logged.

$message: The message to store in the log. If empty, a text that contains all useful information about the passed-in exception is used.

$variables: Array of variables to replace in the message on display. Defaults to the return value of _drupal_decode_exception().

$severity: The severity of the message, as per RFC 3164.

$link: A link to associate with the message.

See also

watchdog_exception()

_drupal_decode_exception()

4 calls to ultimate_cron_watchdog_throwable()
UltimateCronBackgroundProcessLegacyLauncher::job_callback in plugins/ultimate_cron/launcher/background_process_legacy.class.php
Background Process legacy callback for running cron jobs.
UltimateCronLauncher::run in ./ultimate_cron.plugin.inc
Run the job.
UltimateCronQueueSettings::worker_callback in plugins/ultimate_cron/settings/queue.class.php
Process a cron queue.
UltimateCronSerialLauncher::launch in plugins/ultimate_cron/launcher/serial.class.php
Launcher.

File

./ultimate_cron.module, line 1773

Code

function ultimate_cron_watchdog_throwable($type, Throwable $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) {

  // Use a default value if $message is not set.
  if (empty($message)) {

    // The exception message is run through check_plain() by _drupal_decode_exception().
    $message = '%type: !message in %function (line %line of %file).';
  }

  // $variables must be an array so that we can add the exception information.
  if (!is_array($variables)) {
    $variables = array();
  }
  require_once DRUPAL_ROOT . '/includes/errors.inc';
  $variables += _drupal_decode_exception($exception);
  watchdog($type, $message, $variables, $severity, $link);
}