1 /*
2 * Copyright 2004-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 #ifndef PCMK__COMMON_LOGGING_COMPAT__H
11 # define PCMK__COMMON_LOGGING_COMPAT__H
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 /**
18 * \file
19 * \brief Deprecated Pacemaker logging API
20 * \ingroup core
21 * \deprecated Do not include this header directly. Do not use Pacemaker
22 * libraries for general-purpose logging; libqb's logging API is a
23 * suitable replacement. The logging APIs in this header, and the
24 * header itself, will be removed in a future release.
25 */
26
27 /*!
28 * \brief Log a message using constant priority
29 *
30 * \param[in] level Priority at which to log the message
31 * \param[in] fmt printf-style format string literal for message
32 * \param[in] args Any arguments needed by format string
33 *
34 * \deprecated Do not use Pacemaker for general-purpose logging
35 * \note This is a macro, and \p level may be evaluated more than once.
36 * This does nothing when level is LOG_STDOUT.
37 */
38 # define do_crm_log_always(level, fmt, args...) do { \
39 switch (level) { \
40 case LOG_STDOUT: case LOG_NEVER: \
41 break; \
42 default: \
43 qb_log((level), fmt , ##args); \
44 break; \
45 } \
46 } while (0)
47
48 //! \deprecated Do not use Pacemaker for general-purpose logging
49 gboolean crm_log_cli_init(const char *entity);
50
51 //! \deprecated Do not use Pacemaker for general-purpose logging
52 gboolean crm_add_logfile(const char *filename);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif // PCMK__COMMON_LOGGING_COMPAT__H