pacemaker  2.1.5-b7adf64e51
Scalable High-Availability cluster resource manager
logging_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2021 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 
24 # define pcmk__config_err(fmt...) do { \
25  crm_config_error = TRUE; \
26  crm_err(fmt); \
27  } while (0)
28 
36 # define pcmk__config_warn(fmt...) do { \
37  crm_config_warning = TRUE; \
38  crm_warn(fmt); \
39  } while (0)
40 
55 # define pcmk__log_else(level, else_action) do { \
56  static struct qb_log_callsite *trace_cs = NULL; \
57  \
58  if (trace_cs == NULL) { \
59  trace_cs = qb_log_callsite_get(__func__, __FILE__, "log_else", \
60  level, __LINE__, 0); \
61  } \
62  if (!crm_is_callsite_active(trace_cs, level, 0)) { \
63  else_action; \
64  } \
65  } while(0)
66 
76 void pcmk__cli_init_logging(const char *name, unsigned int verbosity);
77 
78 int pcmk__add_logfile(const char *filename);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #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:311
void pcmk__cli_init_logging(const char *name, unsigned int verbosity)
Definition: logging.c:1091