pacemaker  2.1.6-802a72226b
Scalable High-Availability cluster resource manager
logging_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-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 #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>
21 
29 # define pcmk__config_err(fmt...) do { \
30  crm_config_error = TRUE; \
31  crm_err(fmt); \
32  } while (0)
33 
41 # define pcmk__config_warn(fmt...) do { \
42  crm_config_warning = TRUE; \
43  crm_warn(fmt); \
44  } while (0)
45 
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 
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
const char * name
Definition: cib.c:24
int pcmk__add_logfile(const char *filename)
Add a file to be used as a Pacemaker detail log.
Definition: logging.c:312
void pcmk__free_common_logger(void)
Definition: logging.c:1164
Wrappers for and extensions to libqb logging.
Formatted output for pacemaker tools.
void pcmk__cli_init_logging(const char *name, unsigned int verbosity)
Definition: logging.c:1117
This structure contains everything that makes up a single output formatter.
void pcmk__add_logfiles(gchar **log_files, pcmk__output_t *out)
Add multiple additional log files.
Definition: logging.c:396