diff --git a/scheduler.install b/scheduler.install index 6462e60..bcd15ae 100644 --- a/scheduler.install +++ b/scheduler.install @@ -51,6 +51,7 @@ function scheduler_uninstall() { 'scheduler_date_format', 'scheduler_field_type', 'scheduler_extra_info', + 'scheduler_watchdog_log', ); $types = node_type_get_types(); diff --git a/scheduler.module b/scheduler.module index 559c476..3512fa7 100644 --- a/scheduler.module +++ b/scheduler.module @@ -895,7 +895,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(); @@ -903,7 +906,9 @@ function _scheduler_run_cron() { ob_clean(); } } - watchdog('scheduler', 'Internal scheduler cron run completed', array(), WATCHDOG_NOTICE, l('settings', 'admin/config/content/scheduler')); + if ($log) { + watchdog('scheduler', 'Internal scheduler cron run completed', array(), WATCHDOG_NOTICE, l('settings', 'admin/config/content/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')))); @@ -925,7 +930,18 @@ 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);; } /**