pacemaker
2.1.0-7c3f660
Scalable High-Availability cluster resource manager
|
Wrappers for and extensions to libqb logging. More...
#include <stdio.h>
#include <glib.h>
#include <qb/qblog.h>
#include <libxml/tree.h>
#include <assert.h>
#include <crm/common/logging_compat.h>
Go to the source code of this file.
Macros | |
#define | CRM_LOGGING__H |
#define | LOG_TRACE (LOG_DEBUG+1) |
#define | LOG_STDOUT 254 |
#define | LOG_NEVER 255 |
#define | CRM_XS "|" |
#define | crm_log_output(level, prefix, output) crm_log_output_fn(__FILE__, __func__, __LINE__, level, prefix, output) |
#define | CRM_TRACE_INIT_DATA(name) QB_LOG_INIT_DATA(name) |
#define | do_crm_log(level, fmt, args...) |
Log a message. More... | |
#define | do_crm_log_unlikely(level, fmt, args...) |
Log a message that is likely to be filtered out. More... | |
#define | CRM_LOG_ASSERT(expr) |
#define | CRM_CHECK(expr, failure_action) |
#define | do_crm_log_xml(level, text, xml) |
Log XML line-by-line in a formatted fashion. More... | |
#define | do_crm_log_alias(level, file, function, line, fmt, args...) |
Log a message as if it came from a different code location. More... | |
#define | crm_perror(level, fmt, args...) |
Send a system error message to both the log and stderr. More... | |
#define | crm_log_tag(level, tag, fmt, args...) |
Log a message with a tag (for use with PCMK_trace_tags) More... | |
#define | crm_emerg(fmt, args...) qb_log(LOG_EMERG, fmt , ##args) |
#define | crm_crit(fmt, args...) qb_logt(LOG_CRIT, 0, fmt , ##args) |
#define | crm_err(fmt, args...) qb_logt(LOG_ERR, 0, fmt , ##args) |
#define | crm_warn(fmt, args...) qb_logt(LOG_WARNING, 0, fmt , ##args) |
#define | crm_notice(fmt, args...) qb_logt(LOG_NOTICE, 0, fmt , ##args) |
#define | crm_info(fmt, args...) qb_logt(LOG_INFO, 0, fmt , ##args) |
#define | crm_debug(fmt, args...) do_crm_log_unlikely(LOG_DEBUG, fmt , ##args) |
#define | crm_trace(fmt, args...) do_crm_log_unlikely(LOG_TRACE, fmt , ##args) |
#define | crm_log_xml_crit(xml, text) do_crm_log_xml(LOG_CRIT, text, xml) |
#define | crm_log_xml_err(xml, text) do_crm_log_xml(LOG_ERR, text, xml) |
#define | crm_log_xml_warn(xml, text) do_crm_log_xml(LOG_WARNING, text, xml) |
#define | crm_log_xml_notice(xml, text) do_crm_log_xml(LOG_NOTICE, text, xml) |
#define | crm_log_xml_info(xml, text) do_crm_log_xml(LOG_INFO, text, xml) |
#define | crm_log_xml_debug(xml, text) do_crm_log_xml(LOG_DEBUG, text, xml) |
#define | crm_log_xml_trace(xml, text) do_crm_log_xml(LOG_TRACE, text, xml) |
#define | crm_log_xml_explicit(xml, text) |
#define | crm_str(x) (const char*)(x?x:"<null>") |
Enumerations | |
enum | xml_log_options { xml_log_option_filtered = 0x0001, xml_log_option_formatted = 0x0002, xml_log_option_text = 0x0004, xml_log_option_full_fledged = 0x0008, xml_log_option_diff_plus = 0x0010, xml_log_option_diff_minus = 0x0020, xml_log_option_diff_short = 0x0040, xml_log_option_diff_all = 0x0100, xml_log_option_dirty_add = 0x1000, xml_log_option_open = 0x2000, xml_log_option_children = 0x4000, xml_log_option_close = 0x8000 } |
Functions | |
void | crm_enable_blackbox (int nsig) |
void | crm_disable_blackbox (int nsig) |
void | crm_write_blackbox (int nsig, struct qb_log_callsite *callsite) |
void | crm_update_callsites (void) |
void | crm_log_deinit (void) |
void | crm_log_preinit (const char *entity, int argc, char **argv) |
gboolean | crm_log_init (const char *entity, uint8_t level, gboolean daemon, gboolean to_stderr, int argc, char **argv, gboolean quiet) |
void | crm_log_args (int argc, char **argv) |
Log the command line (once) More... | |
void | crm_log_output_fn (const char *file, const char *function, int line, int level, const char *prefix, const char *output) |
void | crm_bump_log_level (int argc, char **argv) |
Make logging more verbose. More... | |
void | crm_enable_stderr (int enable) |
gboolean | crm_is_callsite_active (struct qb_log_callsite *cs, uint8_t level, uint32_t tags) |
void | log_data_element (int log_level, const char *file, const char *function, int line, const char *prefix, xmlNode *data, int depth, gboolean formatted) |
unsigned int | set_crm_log_level (unsigned int level) |
unsigned int | get_crm_log_level (void) |
Variables | |
unsigned int | crm_log_level |
unsigned int | crm_trace_nonlog |
gboolean | crm_config_error |
gboolean | crm_config_warning |
Wrappers for and extensions to libqb logging.
Definition in file logging.h.
#define CRM_CHECK | ( | expr, | |
failure_action | |||
) |
#define crm_crit | ( | fmt, | |
args... | |||
) | qb_logt(LOG_CRIT, 0, fmt , ##args) |
#define crm_debug | ( | fmt, | |
args... | |||
) | do_crm_log_unlikely(LOG_DEBUG, fmt , ##args) |
#define crm_emerg | ( | fmt, | |
args... | |||
) | qb_log(LOG_EMERG, fmt , ##args) |
#define crm_err | ( | fmt, | |
args... | |||
) | qb_logt(LOG_ERR, 0, fmt , ##args) |
#define crm_info | ( | fmt, | |
args... | |||
) | qb_logt(LOG_INFO, 0, fmt , ##args) |
#define CRM_LOG_ASSERT | ( | expr | ) |
#define crm_log_output | ( | level, | |
prefix, | |||
output | |||
) | crm_log_output_fn(__FILE__, __func__, __LINE__, level, prefix, output) |
#define crm_log_tag | ( | level, | |
tag, | |||
fmt, | |||
args... | |||
) |
Log a message with a tag (for use with PCMK_trace_tags)
[in] | level | Priority at which to log the message |
[in] | tag | String to tag message with |
[in] | fmt | printf-style format string for message |
[in] | args | Any arguments needed by format string |
level
may be evaluated more than once. This does nothing when level is LOG_STDOUT. #define crm_log_xml_crit | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_CRIT, text, xml) |
#define crm_log_xml_debug | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_DEBUG, text, xml) |
#define crm_log_xml_err | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_ERR, text, xml) |
#define crm_log_xml_explicit | ( | xml, | |
text | |||
) |
#define crm_log_xml_info | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_INFO, text, xml) |
#define crm_log_xml_notice | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_NOTICE, text, xml) |
#define crm_log_xml_trace | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_TRACE, text, xml) |
#define crm_log_xml_warn | ( | xml, | |
text | |||
) | do_crm_log_xml(LOG_WARNING, text, xml) |
#define crm_notice | ( | fmt, | |
args... | |||
) | qb_logt(LOG_NOTICE, 0, fmt , ##args) |
#define crm_perror | ( | level, | |
fmt, | |||
args... | |||
) |
Send a system error message to both the log and stderr.
[in] | level | Priority at which to log the message |
[in] | fmt | printf-style format string for message |
[in] | args | Any arguments needed by format string |
level
may be evaluated more than once. #define crm_trace | ( | fmt, | |
args... | |||
) | do_crm_log_unlikely(LOG_TRACE, fmt , ##args) |
#define crm_warn | ( | fmt, | |
args... | |||
) | qb_logt(LOG_WARNING, 0, fmt , ##args) |
#define do_crm_log | ( | level, | |
fmt, | |||
args... | |||
) |
Log a message.
[in] | level | Priority at which to log the message |
[in] | fmt | printf-style format string literal for message |
[in] | args | Any arguments needed by format string |
level
may be evaluated more than once. #define do_crm_log_alias | ( | level, | |
file, | |||
function, | |||
line, | |||
fmt, | |||
args... | |||
) |
Log a message as if it came from a different code location.
[in] | level | Priority at which to log the message |
[in] | file | Source file name to use instead of FILE |
[in] | function | Source function name to use instead of func |
[in] | line | Source line number to use instead of line |
[in] | fmt | printf-style format string literal for message |
[in] | args | Any arguments needed by format string |
level
may be evaluated more than once. #define do_crm_log_unlikely | ( | level, | |
fmt, | |||
args... | |||
) |
Log a message that is likely to be filtered out.
[in] | level | Priority at which to log the message |
[in] | fmt | printf-style format string for message |
[in] | args | Any arguments needed by format string |
level
may be evaluated more than once. This does nothing when level is LOG_STDOUT. #define do_crm_log_xml | ( | level, | |
text, | |||
xml | |||
) |
Log XML line-by-line in a formatted fashion.
[in] | level | Priority at which to log the messages |
[in] | text | Prefix for each line |
[in] | xml | XML to log |
level
may be evaluated more than once. This does nothing when level is LOG_STDOUT. enum xml_log_options |
void crm_bump_log_level | ( | int | argc, |
char ** | argv | ||
) |
gboolean crm_is_callsite_active | ( | struct qb_log_callsite * | cs, |
uint8_t | level, | ||
uint32_t | tags | ||
) |
void crm_log_args | ( | int | argc, |
char ** | argv | ||
) |
gboolean crm_log_init | ( | const char * | entity, |
uint8_t | level, | ||
gboolean | daemon, | ||
gboolean | to_stderr, | ||
int | argc, | ||
char ** | argv, | ||
gboolean | quiet | ||
) |
void crm_log_output_fn | ( | const char * | file, |
const char * | function, | ||
int | line, | ||
int | level, | ||
const char * | prefix, | ||
const char * | output | ||
) |
void crm_log_preinit | ( | const char * | entity, |
int | argc, | ||
char ** | argv | ||
) |
void crm_write_blackbox | ( | int | nsig, |
struct qb_log_callsite * | callsite | ||
) |
void log_data_element | ( | int | log_level, |
const char * | file, | ||
const char * | function, | ||
int | line, | ||
const char * | prefix, | ||
xmlNode * | data, | ||
int | depth, | ||
gboolean | formatted | ||
) |
gboolean crm_config_error |
gboolean crm_config_warning |