| 396 | |
| 397 | |
| 398 | void |
| 399 | log_action(unsigned int log_level, const char *pre_text, action_t * action, gboolean details) |
| 400 | { |
| 401 | const char *node_uname = NULL; |
| 402 | const char *node_uuid = NULL; |
| 403 | |
| 404 | if (action == NULL) { |
| 405 | crm_trace("%s%s: <NULL>", pre_text == NULL ? "" : pre_text, pre_text == NULL ? "" : ": "); |
| 406 | return; |
| 407 | } |
| 408 | |
| 409 | if (is_set(action->flags, pe_action_pseudo)) { |
| 410 | node_uname = NULL; |
| 411 | node_uuid = NULL; |
| 412 | |
| 413 | } else if (action->node != NULL) { |
| 414 | node_uname = action->node->details->uname; |
| 415 | node_uuid = action->node->details->id; |
| 416 | } else { |
| 417 | node_uname = "<none>"; |
| 418 | node_uuid = NULL; |
| 419 | } |
| 420 | |
| 421 | switch (text2task(action->task)) { |
| 422 | case stonith_node: |
| 423 | case shutdown_crm: |
| 424 | crm_trace( |
| 425 | "%s%s%sAction %d: %s%s%s%s%s%s", |
| 426 | pre_text == NULL ? "" : pre_text, |
| 427 | pre_text == NULL ? "" : ": ", |
| 428 | is_set(action->flags, |
| 429 | pe_action_pseudo) ? "Pseduo " : is_set(action->flags, |
| 430 | pe_action_optional) ? |
| 431 | "Optional " : is_set(action->flags, |
| 432 | pe_action_runnable) ? is_set(action->flags, |
| 433 | pe_action_processed) |
| 434 | ? "" : "(Provisional) " : "!!Non-Startable!! ", action->id, |
| 435 | action->uuid, node_uname ? "\ton " : "", |
| 436 | node_uname ? node_uname : "", node_uuid ? "\t\t(" : "", |
| 437 | node_uuid ? node_uuid : "", node_uuid ? ")" : ""); |
| 438 | break; |
| 439 | default: |
| 440 | crm_trace( |
| 441 | "%s%s%sAction %d: %s %s%s%s%s%s%s", |
| 442 | pre_text == NULL ? "" : pre_text, |
| 443 | pre_text == NULL ? "" : ": ", |
| 444 | is_set(action->flags, |
| 445 | pe_action_optional) ? "Optional " : is_set(action->flags, |
| 446 | pe_action_pseudo) |
| 447 | ? "Pseduo " : is_set(action->flags, |
| 448 | pe_action_runnable) ? is_set(action->flags, |
| 449 | pe_action_processed) |
| 450 | ? "" : "(Provisional) " : "!!Non-Startable!! ", action->id, |
| 451 | action->uuid, action->rsc?action->rsc->id:"<none>", |
| 452 | node_uname ? "\ton " : "", node_uname ? node_uname : "", |
| 453 | node_uuid ? "\t\t(" : "", node_uuid ? node_uuid : "", |
| 454 | node_uuid ? ")" : ""); |
| 455 |
no test coverage detected