root/include/crm/common/logging_compat.h

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

INCLUDED FROM


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

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