1
2
3
4
5
6
7
8
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 #ifndef PCMK__LOGGING_INTERNAL_H
15 # define PCMK__LOGGING_INTERNAL_H
16
17 # include <glib.h>
18
19 # include <crm/common/logging.h>
20 # include <crm/common/output_internal.h>
21
22
23
24
25
26
27
28
29 # define pcmk__config_err(fmt...) do { \
30 crm_config_error = TRUE; \
31 crm_err(fmt); \
32 } while (0)
33
34
35
36
37
38
39
40
41 # define pcmk__config_warn(fmt...) do { \
42 crm_config_warning = TRUE; \
43 crm_warn(fmt); \
44 } while (0)
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 # define pcmk__if_tracing(if_action, else_action) do { \
60 static struct qb_log_callsite *trace_cs = NULL; \
61 \
62 if (trace_cs == NULL) { \
63 trace_cs = qb_log_callsite_get(__func__, __FILE__, \
64 "if_tracing", LOG_TRACE, \
65 __LINE__, crm_trace_nonlog); \
66 } \
67 if (crm_is_callsite_active(trace_cs, LOG_TRACE, \
68 crm_trace_nonlog)) { \
69 if_action; \
70 } else { \
71 else_action; \
72 } \
73 } while (0)
74
75
76
77
78
79
80
81
82
83
84 void pcmk__cli_init_logging(const char *name, unsigned int verbosity);
85
86 int pcmk__add_logfile(const char *filename);
87 void pcmk__add_logfiles(gchar **log_files, pcmk__output_t *out);
88
89 void pcmk__free_common_logger(void);
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif