pacemaker
2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
|
#include <crm_internal.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <pwd.h>
#include <grp.h>
#include <time.h>
#include <libgen.h>
#include <signal.h>
#include <bzlib.h>
#include <qb/qbdefs.h>
#include <crm/crm.h>
#include <crm/common/mainloop.h>
#include <crm/common/logging_compat.h>
Go to the source code of this file.
Macros | |
#define | TIMESTAMP_FORMAT_SPEC "%%t" |
#define | NAME_MAX 256 |
#define | FMT_MAX 256 |
#define | DEFAULT_LOG_FILE CRM_LOG_DIR "/pacemaker.log" |
Typedefs | |
typedef time_t | log_time_t |
Functions | |
void | crm_log_deinit (void) |
int | pcmk__add_logfile (const char *filename) |
Add a file to be used as a Pacemaker detail log. More... | |
void | pcmk__add_logfiles (gchar **log_files, pcmk__output_t *out) |
Add multiple additional log files. More... | |
void | crm_enable_blackbox (int nsig) |
void | crm_disable_blackbox (int nsig) |
void | crm_write_blackbox (int nsig, const struct qb_log_callsite *cs) |
gboolean | crm_is_callsite_active (struct qb_log_callsite *cs, uint8_t level, uint32_t tags) |
void | crm_update_callsites (void) |
void | crm_log_preinit (const char *entity, int argc, char *const *argv) |
Initializes the logging system and defaults to the least verbose output level. More... | |
gboolean | crm_log_init (const char *entity, uint8_t level, gboolean daemon, gboolean to_stderr, int argc, char **argv, gboolean quiet) |
unsigned int | set_crm_log_level (unsigned int level) |
void | crm_enable_stderr (int enable) |
void | crm_bump_log_level (int argc, char **argv) |
Make logging more verbose. More... | |
unsigned int | get_crm_log_level (void) |
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 | pcmk__cli_init_logging (const char *name, unsigned int verbosity) |
void | pcmk_log_xml_as (const char *file, const char *function, uint32_t line, uint32_t tags, uint8_t level, const char *text, const xmlNode *xml) |
Log XML line-by-line in a formatted fashion. More... | |
void | pcmk__log_xml_changes_as (const char *file, const char *function, uint32_t line, uint32_t tags, uint8_t level, const xmlNode *xml) |
void | pcmk__log_xml_patchset_as (const char *file, const char *function, uint32_t line, uint32_t tags, uint8_t level, const xmlNode *patchset) |
void | pcmk__free_common_logger (void) |
gboolean | crm_log_cli_init (const char *entity) |
gboolean | crm_add_logfile (const char *filename) |
void | pcmk_log_xml_impl (uint8_t level, const char *text, const xmlNode *xml) |
void | pcmk__set_config_error_handler (pcmk__config_error_func error_handler, void *error_context) |
void | pcmk__set_config_warning_handler (pcmk__config_warning_func warning_handler, void *warning_context) |
Variables | |
unsigned int | crm_log_level = LOG_INFO |
unsigned int | crm_trace_nonlog = 0 |
bool | pcmk__is_daemon = false |
char * | pcmk__our_nodename = NULL |
Node name of the local node. More... | |
pcmk__config_error_func | pcmk__config_error_handler = NULL |
pcmk__config_warning_func | pcmk__config_warning_handler = NULL |
void * | pcmk__config_error_context = NULL |
void * | pcmk__config_warning_context = NULL |
#define DEFAULT_LOG_FILE CRM_LOG_DIR "/pacemaker.log" |
typedef time_t log_time_t |
gboolean crm_add_logfile | ( | const char * | filename | ) |
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_cli_init | ( | const char * | entity | ) |
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 *const * | argv | ||
) |
void crm_write_blackbox | ( | int | nsig, |
const struct qb_log_callsite * | cs | ||
) |
int pcmk__add_logfile | ( | const char * | filename | ) |
void pcmk__add_logfiles | ( | gchar ** | log_files, |
pcmk__output_t * | out | ||
) |
void pcmk__cli_init_logging | ( | const char * | name, |
unsigned int | verbosity | ||
) |
void pcmk__log_xml_changes_as | ( | const char * | file, |
const char * | function, | ||
uint32_t | line, | ||
uint32_t | tags, | ||
uint8_t | level, | ||
const xmlNode * | xml | ||
) |
void pcmk__log_xml_patchset_as | ( | const char * | file, |
const char * | function, | ||
uint32_t | line, | ||
uint32_t | tags, | ||
uint8_t | level, | ||
const xmlNode * | patchset | ||
) |
void pcmk__set_config_error_handler | ( | pcmk__config_error_func | error_handler, |
void * | error_context | ||
) |
void pcmk__set_config_warning_handler | ( | pcmk__config_warning_func | warning_handler, |
void * | warning_context | ||
) |
void pcmk_log_xml_as | ( | const char * | file, |
const char * | function, | ||
uint32_t | line, | ||
uint32_t | tags, | ||
uint8_t | level, | ||
const char * | text, | ||
const xmlNode * | xml | ||
) |
Log XML line-by-line in a formatted fashion.
[in] | file | File name to use for log filtering |
[in] | function | Function name to use for log filtering |
[in] | line | Line number to use for log filtering |
[in] | tags | Logging tags to use for log filtering |
[in] | level | Priority at which to log the messages |
[in] | text | Prefix for each line |
[in] | xml | XML to log |
level
is LOG_STDOUT
. do_crm_log_xml()
macro. void pcmk_log_xml_impl | ( | uint8_t | level, |
const char * | text, | ||
const xmlNode * | xml | ||
) |
pcmk__config_error_func pcmk__config_error_handler = NULL |
pcmk__config_warning_func pcmk__config_warning_handler = NULL |