14#ifndef PCMK__LOGGING_INTERNAL_H
15# define PCMK__LOGGING_INTERNAL_H
41# define pcmk__config_err(fmt...) do { \
42 crm_config_error = TRUE; \
43 if (pcmk__config_error_handler == NULL) { \
46 pcmk__config_error_handler(pcmk__config_error_context, fmt); \
57# define pcmk__config_warn(fmt...) do { \
58 crm_config_warning = TRUE; \
59 if (pcmk__config_warning_handler == NULL) { \
62 pcmk__config_warning_handler(pcmk__config_warning_context, fmt); \
79# define pcmk__if_tracing(if_action, else_action) do { \
80 static struct qb_log_callsite *trace_cs = NULL; \
82 if (trace_cs == NULL) { \
83 trace_cs = qb_log_callsite_get(__func__, __FILE__, \
84 "if_tracing", LOG_TRACE, \
85 __LINE__, crm_trace_nonlog); \
87 if (crm_is_callsite_active(trace_cs, LOG_TRACE, \
88 crm_trace_nonlog)) { \
104#define pcmk__log_xml_changes(level, xml) do { \
105 uint8_t _level = pcmk__clip_log_level(level); \
106 static struct qb_log_callsite *xml_cs = NULL; \
113 if (xml_cs == NULL) { \
114 xml_cs = qb_log_callsite_get(__func__, __FILE__, \
115 "xml-changes", _level, \
118 if (crm_is_callsite_active(xml_cs, _level, 0)) { \
119 pcmk__log_xml_changes_as(__FILE__, __func__, __LINE__, \
135#define pcmk__log_xml_patchset(level, patchset) do { \
136 uint8_t _level = pcmk__clip_log_level(level); \
137 static struct qb_log_callsite *xml_cs = NULL; \
144 if (xml_cs == NULL) { \
145 xml_cs = qb_log_callsite_get(__func__, __FILE__, \
146 "xml-patchset", _level, \
149 if (crm_is_callsite_active(xml_cs, _level, 0)) { \
150 pcmk__log_xml_patchset_as(__FILE__, __func__, __LINE__, \
151 0, _level, patchset); \
158 uint32_t line, uint32_t tags, uint8_t level,
162 uint32_t line, uint32_t tags, uint8_t level,
163 const xmlNode *patchset);
Wrappers for and extensions to libqb logging.
void(* pcmk__config_warning_func)(void *ctx, const char *msg,...)
int pcmk__add_logfile(const char *filename)
Add a file to be used as a Pacemaker detail log.
void pcmk__free_common_logger(void)
pcmk__config_warning_func pcmk__config_warning_handler
void pcmk__log_xml_patchset_as(const char *file, const char *function, uint32_t line, uint32_t tags, uint8_t level, const xmlNode *patchset)
void * pcmk__config_warning_context
void pcmk__add_logfiles(gchar **log_files, pcmk__output_t *out)
Add multiple additional log files.
void pcmk__set_config_error_handler(pcmk__config_error_func error_handler, void *error_context)
void(* pcmk__config_error_func)(void *ctx, const char *msg,...)
void pcmk__set_config_warning_handler(pcmk__config_warning_func warning_handler, void *warning_context)
void * pcmk__config_error_context
void pcmk__log_xml_changes_as(const char *file, const char *function, uint32_t line, uint32_t tags, uint8_t level, const xmlNode *xml)
void pcmk__cli_init_logging(const char *name, unsigned int verbosity)
pcmk__config_error_func pcmk__config_error_handler
Formatted output for pacemaker tools.
This structure contains everything that makes up a single output formatter.