pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
logging_compat.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2024 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU General Public License version 2
7  * or later (GPLv2+) WITHOUT ANY WARRANTY.
8  */
9 
10 #ifndef PCMK__CRM_COMMON_LOGGING_COMPAT__H
11 #define PCMK__CRM_COMMON_LOGGING_COMPAT__H
12 
13 #include <stdint.h> // uint8_t
14 #include <glib.h>
15 #include <libxml/tree.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
31 enum xml_log_options {
45 };
46 
58 #define do_crm_log_always(level, fmt, args...) do { \
59  switch (level) { \
60  case LOG_STDOUT: case LOG_NEVER: \
61  break; \
62  default: \
63  qb_log((level), fmt , ##args); \
64  break; \
65  } \
66  } while (0)
67 
69 #define crm_str(x) (const char *) ((x)? (x) : "<null>")
70 
72 gboolean crm_log_cli_init(const char *entity);
73 
75 gboolean crm_add_logfile(const char *filename);
76 
78 void log_data_element(int log_level, const char *file, const char *function,
79  int line, const char *prefix, const xmlNode *data,
80  int depth, int legacy_options);
81 
83 void pcmk_log_xml_impl(uint8_t level, const char *text, const xmlNode *xml);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif // PCMK__CRM_COMMON_LOGGING_COMPAT__H
char data[0]
Definition: cpg.c:58
void pcmk_log_xml_impl(uint8_t level, const char *text, const xmlNode *xml)
Definition: logging.c:1279
gboolean crm_log_cli_init(const char *entity)
Definition: logging.c:1266
void log_data_element(int log_level, const char *file, const char *function, int line, const char *prefix, const xmlNode *data, int depth, int legacy_options)
Definition: xml_display.c:410
gboolean crm_add_logfile(const char *filename)
Definition: logging.c:1273
xml_log_options