root/include/crm/common/logging_compat.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   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 
  20 /**
  21  * \file
  22  * \brief Deprecated Pacemaker logging API
  23  * \ingroup core
  24  * \deprecated Do not include this header directly. Do not use Pacemaker
  25  *             libraries for general-purpose logging; libqb's logging API is a
  26  *             suitable replacement. The logging APIs in this header, and the
  27  *             header itself, will be removed in a future release.
  28  */
  29 
  30 //! \deprecated This enum will be removed in a future release
  31 enum xml_log_options {
  32     xml_log_option_filtered     = 0x0001,
  33     xml_log_option_formatted    = 0x0002,
  34     xml_log_option_text         = 0x0004,
  35     xml_log_option_full_fledged = 0x0008,
  36     xml_log_option_diff_plus    = 0x0010,
  37     xml_log_option_diff_minus   = 0x0020,
  38     xml_log_option_diff_short   = 0x0040,
  39     xml_log_option_diff_all     = 0x0100,
  40     xml_log_option_dirty_add    = 0x1000,
  41     xml_log_option_open         = 0x2000,
  42     xml_log_option_children     = 0x4000,
  43     xml_log_option_close        = 0x8000,
  44 };
  45 
  46 /*!
  47  * \brief Log a message using constant priority
  48  *
  49  * \param[in] level     Priority at which to log the message
  50  * \param[in] fmt       printf-style format string literal for message
  51  * \param[in] args      Any arguments needed by format string
  52  *
  53  * \deprecated Do not use Pacemaker for general-purpose logging
  54  * \note This is a macro, and \p level may be evaluated more than once.
  55  *       This does nothing when level is LOG_STDOUT.
  56  */
  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 
  67 //! \deprecated Do not use Pacemaker for general-purpose string handling
  68 #define crm_str(x) (const char *) ((x)? (x) : "<null>")
  69 
  70 //! \deprecated Do not use Pacemaker for general-purpose logging
  71 gboolean crm_log_cli_init(const char *entity);
  72 
  73 //! \deprecated Do not use Pacemaker for general-purpose logging
  74 gboolean crm_add_logfile(const char *filename);
  75 
  76 //! \deprecated Do not use Pacemaker for general-purpose logging
  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

/* [previous][next][first][last][top][bottom][index][help] */