pacemaker  2.1.6-802a72226b
Scalable High-Availability cluster resource manager
logging_compat.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2023 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 <glib.h>
14 #include <libxml/tree.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
30 enum xml_log_options {
44 };
45 
57 # define do_crm_log_always(level, fmt, args...) do { \
58  switch (level) { \
59  case LOG_STDOUT: case LOG_NEVER: \
60  break; \
61  default: \
62  qb_log((level), fmt , ##args); \
63  break; \
64  } \
65  } while (0)
66 
68 #define crm_str(x) (const char *) ((x)? (x) : "<null>")
69 
71 gboolean crm_log_cli_init(const char *entity);
72 
74 gboolean crm_add_logfile(const char *filename);
75 
77 void log_data_element(int log_level, const char *file, const char *function,
78  int line, const char *prefix, const xmlNode *data,
79  int depth, int legacy_options);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif // PCMK__CRM_COMMON_LOGGING_COMPAT__H
char data[0]
Definition: cpg.c:55
gboolean crm_log_cli_init(const char *entity)
Definition: logging.c:1179
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:1186
xml_log_options