This source file includes following definitions.
- do_log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #include <crm_internal.h>
19
20 #include <crm/crm.h>
21 #include <crm/cib.h>
22 #include <crm/msg_xml.h>
23 #include <crm/common/xml.h>
24
25 #include <crmd_fsa.h>
26 #include <crmd_messages.h>
27
28
29 void
30 do_log(long long action,
31 enum crmd_fsa_cause cause,
32 enum crmd_fsa_state cur_state, enum crmd_fsa_input current_input, fsa_data_t * msg_data)
33 {
34 unsigned log_type = LOG_TRACE;
35
36 if (action & A_LOG) {
37 log_type = LOG_INFO;
38 } else if (action & A_WARN) {
39 log_type = LOG_WARNING;
40 } else if (action & A_ERROR) {
41 log_type = LOG_ERR;
42 }
43
44 do_crm_log(log_type, "Input %s received in state %s from %s",
45 fsa_input2string(msg_data->fsa_input),
46 fsa_state2string(cur_state), msg_data->origin);
47
48 if (msg_data->data_type == fsa_dt_ha_msg) {
49 ha_msg_input_t *input = fsa_typed_data(msg_data->data_type);
50
51 crm_log_xml_debug(input->msg, __FUNCTION__);
52
53 } else if (msg_data->data_type == fsa_dt_xml) {
54 xmlNode *input = fsa_typed_data(msg_data->data_type);
55
56 crm_log_xml_debug(input, __FUNCTION__);
57
58 } else if (msg_data->data_type == fsa_dt_lrm) {
59 lrmd_event_data_t *input = fsa_typed_data(msg_data->data_type);
60
61 do_crm_log(log_type,
62 "Resource %s: Call ID %d returned %d (%d)."
63 " New status if rc=0: %s",
64 input->rsc_id, input->call_id, input->rc,
65 input->op_status, (char *)input->user_data);
66 }
67 }