You are here

function elysia_cron_debug in Elysia Cron 7.2

Same name and namespace in other branches
  1. 6.2 elysia_cron.module \elysia_cron_debug()

Log a debug in watchdog (do not print an user message).

Drush see it in verbose mode.

7 calls to elysia_cron_debug()
elysia_cron_internal_execute_channel in ./elysia_cron.module
Internal function to execute all jobs in a channel.
elysia_cron_internal_execute_channel_completed in ./elysia_cron.module
Successful termination (after all shutdown hooks invoked by cron functions).
elysia_cron_internal_execute_job in ./elysia_cron.module
Internal function to execute a single job.
elysia_cron_run in ./elysia_cron.module
Public function to invoke a complete cron_run.
elysia_cron_run_channel in ./elysia_cron.module
Public function to execute all jobs in a channel.

... See full list

File

./elysia_cron.module, line 928

Code

function elysia_cron_debug($message, $vars = array(), $type = WATCHDOG_NOTICE) {
  global $_elysia_cron_drush;
  if ($type < WATCHDOG_NOTICE || variable_get('elysia_cron_debug_messages', 0)) {
    watchdog('cron', $message, $vars, $type);
  }
  if (!empty($_elysia_cron_drush) && $_elysia_cron_drush >= 2 && ($type >= WATCHDOG_NOTICE || drush_get_option("verbose", FALSE))) {
    if ($type >= WATCHDOG_NOTICE) {
      drush_print(strip_tags(dt($message, $vars)));
    }
    else {
      drush_log(strip_tags(dt($message, $vars)), $type == WATCHDOG_ERROR ? "error" : ($type == WATCHDOG_ERROR ? "warning" : "notice"));
    }
  }
}