diff --git a/hosting.module b/hosting.module index b1ef2d3bca2b3b2ee03352154ba6179443c0f4f1..881f924e4fe7506dfe2079fd463e1969593778c4 100644 --- a/hosting.module +++ b/hosting.module @@ -1320,6 +1320,20 @@ function hosting_settings($form, &$form_state) { '#default_value' => variable_get('hosting_cron_use_backend', TRUE), ); } + + $types = implode(', ', db_query('SELECT type FROM {hosting_task_log} GROUP BY type ORDER BY type')->fetchCol()); + if (empty($types)) { + $types = 'error warning info message notice ok status success warning'; + } + $form['hosting_task_logs_types_display'] = array( + '#type' => 'textarea', + '#title' => t('Task Logs to Display'), + '#description' => t('Enter the types of logs you wish to show to the user, separated by spaces. Available log types are: %types', array( + '%types' => $types, + )), + '#rows' => 2, + '#default_value' => variable_get('hosting_task_logs_types_display', 'error warning info message ok status success warning'), + ); return system_settings_form($form); } diff --git a/task/hosting_task.module b/task/hosting_task.module index 692a41de9ea91938ca662a6dd32bcaa1ed4b63b3..10f39c3271e1532a4c91653ab1df32cd25fa73db 100644 --- a/task/hosting_task.module +++ b/task/hosting_task.module @@ -1197,9 +1197,12 @@ function hosting_task_view($node, $view_mode, $langcode = NULL) { * Display table containing the logged information for this task. */ function _hosting_task_log_table($node, $last_position = 0) { - $result = db_query("SELECT * FROM {hosting_task_log} WHERE vid = :vid AND lid > :lid ORDER BY lid", array(':vid' => $node->vid, ':lid' => $last_position)); + + $types = explode(' ', variable_get('hosting_task_logs_types_display', 'error warning info message ok status success warning')); + + $result = db_query("SELECT * FROM {hosting_task_log} WHERE vid = :vid AND lid > :lid AND type IN (:types) ORDER BY lid", array(':vid' => $node->vid, ':lid' => $last_position, ':types' => $types)); if ($result) { - $headers = array('data' => 'Log message', 'execution_time' => 'Execution time'); + $headers = array('data' => 'Log message', 'execution_time' => 'Execution time', ''); $rows = array(); $last_lid = $last_position; $last_timestamp = 0; @@ -1237,7 +1240,7 @@ function _hosting_task_log_table($node, $last_position = 0) { } if ($row_count > -1) { - $rows[$row_count]['data'][] = array( + $rows[$row_count]['data'][1] = array( 'data' => $exec_time, ); } @@ -1250,6 +1253,8 @@ function _hosting_task_log_table($node, $last_position = 0) { 'data' => $message, 'class' => array('hosting-status'), ), + '', + $entry->type, ); $rows[] = array(