diff --git a/scheduler.install b/scheduler.install index 4584f80..7f77453 100644 --- a/scheduler.install +++ b/scheduler.install @@ -51,6 +51,7 @@ function scheduler_uninstall() { 'scheduler_date_format', 'scheduler_field_type', 'scheduler_extra_info', + 'scheduler_cron_settings', ); $types = node_type_get_types(); diff --git a/scheduler.module b/scheduler.module index 48b22d1..a637595 100644 --- a/scheduler.module +++ b/scheduler.module @@ -860,7 +860,10 @@ function scheduler_theme() { } function _scheduler_run_cron() { - watchdog('scheduler', 'Internal scheduler cron run activated', array(), WATCHDOG_NOTICE); + $log = variable_get('scheduler_watchdog_log', 1); + if ($log) { + watchdog('scheduler', 'Internal scheduler cron run activated', array(), WATCHDOG_NOTICE); + } scheduler_cron(); if (ob_get_level() > 0) { $handlers = ob_list_handlers(); @@ -868,7 +871,9 @@ function _scheduler_run_cron() { ob_clean(); } } - watchdog('scheduler', 'Internal scheduler cron run completed', array(), WATCHDOG_NOTICE, l('settings', 'admin/settings/scheduler')); + if ($log) { + watchdog('scheduler', 'Internal scheduler cron run completed', array(), WATCHDOG_NOTICE, l('settings', 'admin/settings/scheduler')); + } // This message is only seen when the lightweight cron is tested interactively. drupal_set_message(t("Scheduler's lightweight cron completed. See !log for details.", array('!log' => l('admin/reports/dblog', 'admin/reports/dblog')))); @@ -883,6 +888,7 @@ function _scheduler_run_cron() { */ function _scheduler_lightweight_cron() { $form = array(); + $form['scheduler_cron'] = array( '#type' => 'submit', '#prefix' => t("You can test Scheduler's lightweight cron process interactively") . ':
' , @@ -890,7 +896,21 @@ function _scheduler_lightweight_cron() { '#submit' => array('_scheduler_run_cron'), '#suffix' => "
\n", ); - return $form; + + $form['scheduler_cron_settings'] = array( + '#type' => 'fieldset', + '#title' => t("Lightweight cron settings"), + ); + + $form['scheduler_cron_settings']['scheduler_watchdog_log'] = array( + '#type' => 'checkbox', + '#title' => t('Log activation and completion messages'), + '#default_value' => variable_get('scheduler_watchdog_log', 1), + '#description' => t("If checked, entries will appear in the dblog each time scheduler's cron process is started and completed. This is useful when setting up and testing scheduler's cron, but can result in a large amount of dblog entries. You might want to disable this setting once you've verified that scheduler's cron is running correctly."), + ); + + + return system_settings_form($form); } /**