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 <stdint.h>         // uint8_t
  14 #include <glib.h>
  15 #include <libxml/tree.h>
  16 
  17 #ifdef __cplusplus
  18 extern "C" {
  19 #endif
  20 
  21 /**
  22  * \file
  23  * \brief Deprecated Pacemaker logging API
  24  * \ingroup core
  25  * \deprecated Do not include this header directly. Do not use Pacemaker
  26  *             libraries for general-purpose logging; libqb's logging API is a
  27  *             suitable replacement. The logging APIs in this header, and the
  28  *             header itself, will be removed in a future release.
  29  */
  30 
  31 //! \deprecated This enum will be removed in a future release
  32 enum xml_log_options {
  33     xml_log_option_filtered     = 0x0001,
  34     xml_log_option_formatted    = 0x0002,
  35     xml_log_option_text         = 0x0004,
  36     xml_log_option_full_fledged = 0x0008,
  37     xml_log_option_diff_plus    = 0x0010,
  38     xml_log_option_diff_minus   = 0x0020,
  39     xml_log_option_diff_short   = 0x0040,
  40     xml_log_option_diff_all     = 0x0100,
  41     xml_log_option_dirty_add    = 0x1000,
  42     xml_log_option_open         = 0x2000,
  43     xml_log_option_children     = 0x4000,
  44     xml_log_option_close        = 0x8000,
  45 };
  46 
  47 /*!
  48  * \brief Log a message using constant priority
  49  *
  50  * \param[in] level     Priority at which to log the message
  51  * \param[in] fmt       printf-style format string literal for message
  52  * \param[in] args      Any arguments needed by format string
  53  *
  54  * \deprecated Do not use Pacemaker for general-purpose logging
  55  * \note This is a macro, and \p level may be evaluated more than once.
  56  *       This does nothing when level is LOG_STDOUT.
  57  */
  58 #  define do_crm_log_always(level, fmt, args...) do {                       \
  59         switch (level) {                                                    \
  60             case LOG_STDOUT: case LOG_NEVER:                                \
  61                 break;                                                      \
  62             default:                                                        \
  63                 qb_log((level), fmt , ##args);                              \
  64                 break;                                                      \
  65         }                                                                   \
  66     } while (0)
  67 
  68 //! \deprecated Do not use Pacemaker for general-purpose string handling
  69 #define crm_str(x) (const char *) ((x)? (x) : "<null>")
  70 
  71 //! \deprecated Do not use Pacemaker for general-purpose logging
  72 gboolean crm_log_cli_init(const char *entity);
  73 
  74 //! \deprecated Do not use Pacemaker for general-purpose logging
  75 gboolean crm_add_logfile(const char *filename);
  76 
  77 //! \deprecated Do not use Pacemaker for general-purpose logging
  78 void log_data_element(int log_level, const char *file, const char *function,
  79                       int line, const char *prefix, const xmlNode *data,
  80                       int depth, int legacy_options);
  81 
  82 //! \deprecated Do not use Pacemaker for general-purpose logging
  83 void pcmk_log_xml_impl(uint8_t level, const char *text, const xmlNode *xml);
  84 
  85 #ifdef __cplusplus
  86 }
  87 #endif
  88 
  89 #endif // PCMK__CRM_COMMON_LOGGING_COMPAT__H

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