Permalink
Browse files

Merge pull request #1062 from yuusuke/improbe_logging

Improvement of the log
  • Loading branch information...
kgaillot committed Jun 14, 2016
2 parents dd46368 + 5a5cc7d commit 7130937f240680043d1d0cd07e4c046be12fdadf
Showing with 19 additions and 8 deletions.
  1. +12 −8 crmd/lrm.c
  2. +7 −0 include/crm/crm.h
View
@@ -2368,33 +2368,37 @@ process_lrm_event(lrm_state_t * lrm_state, lrmd_event_data_t * op, struct recurr
case PCMK_LRM_OP_CANCELLED:
crm_info("Result of %s operation for %s on %s: %s "
CRM_XS " call=%d key=%s confirmed=%s",
op->op_type, op->rsc_id, lrm_state->node_name,
crm_action_str(op->op_type, op->interval),
op->rsc_id, lrm_state->node_name,
services_lrm_status_str(op->op_status),
op->call_id, op_key, (removed? "true" : "false"));
break;
case PCMK_LRM_OP_DONE:
do_crm_log(op->interval?LOG_INFO:LOG_NOTICE,
"Result of %s operation for %s on %s: %s "
CRM_XS " call=%d key=%s confirmed=%s rc=%d cib-update=%d",
op->op_type, op->rsc_id, lrm_state->node_name,
services_ocf_exitcode_str(op->rc),
"Result of %s operation for %s on %s: %d (%s) "
CRM_XS " call=%d key=%s confirmed=%s cib-update=%d",
crm_action_str(op->op_type, op->interval),
op->rsc_id, lrm_state->node_name,
op->rc, services_ocf_exitcode_str(op->rc),
op->call_id, op_key, (removed? "true" : "false"),
op->rc, update_id);
update_id);
break;
case PCMK_LRM_OP_TIMEOUT:
crm_err("Result of %s operation for %s on %s: %s "
CRM_XS " call=%d key=%s timeout=%dms",
op->op_type, op->rsc_id, lrm_state->node_name,
crm_action_str(op->op_type, op->interval),
op->rsc_id, lrm_state->node_name,
services_lrm_status_str(op->op_status),
op->call_id, op_key, op->timeout);
break;
default:
crm_err("Result of %s operation for %s on %s: %s "
CRM_XS " call=%d key=%s confirmed=%s status=%d cib-update=%d",
op->op_type, op->rsc_id, lrm_state->node_name,
crm_action_str(op->op_type, op->interval),
op->rsc_id, lrm_state->node_name,
services_lrm_status_str(op->op_status), op->call_id, op_key,
(removed? "true" : "false"), op->op_status, update_id);
}
View
@@ -200,4 +200,11 @@ typedef GList *GListPtr;
guint crm_strcase_hash(gconstpointer v);
guint g_str_hash_traditional(gconstpointer v);
static inline const char *crm_action_str(const char *task, int interval) {
if(safe_str_eq(task, RSC_STATUS) && !interval) {
return "probe";
}
return task;
}
#endif

0 comments on commit 7130937

Please sign in to comment.