From 5a5cc7dadc16e8a3342c6c2577ce456c301cdc05 Mon Sep 17 00:00:00 2001 From: yuusuke Date: Mon, 13 Jun 2016 14:47:37 +0900 Subject: [PATCH] Improvement of the log - Modified so that it is understood that the operation of the probe - Return the return code to the system log --- crmd/lrm.c | 20 ++++++++++++-------- include/crm/crm.h | 7 +++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/crmd/lrm.c b/crmd/lrm.c index ef0109d62c4..efdc43bf185 100644 --- a/crmd/lrm.c +++ b/crmd/lrm.c @@ -2368,25 +2368,28 @@ 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; @@ -2394,7 +2397,8 @@ process_lrm_event(lrm_state_t * lrm_state, lrmd_event_data_t * op, struct recurr 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); } diff --git a/include/crm/crm.h b/include/crm/crm.h index 3e3fac3c418..58a68b0d48d 100644 --- a/include/crm/crm.h +++ b/include/crm/crm.h @@ -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