corosync
3.0.4
|
#include <stdarg.h>
#include <stdlib.h>
#include <syslog.h>
#include <pthread.h>
#include <limits.h>
#include <corosync/corotypes.h>
#include <qb/qbconfig.h>
#include <qb/qblog.h>
Go to the source code of this file.
Macros | |
#define | LOGSYS_MODE_OUTPUT_FILE (1<<0) |
#define | LOGSYS_MODE_OUTPUT_STDERR (1<<1) |
#define | LOGSYS_MODE_OUTPUT_SYSLOG (1<<2) |
#define | LOGSYS_MODE_FORK (1<<3) |
#define | LOGSYS_MODE_THREADED (1<<4) |
#define | LOGSYS_LEVEL_EMERG LOG_EMERG |
#define | LOGSYS_LEVEL_ALERT LOG_ALERT |
#define | LOGSYS_LEVEL_CRIT LOG_CRIT |
#define | LOGSYS_LEVEL_ERROR LOG_ERR |
#define | LOGSYS_LEVEL_WARNING LOG_WARNING |
#define | LOGSYS_LEVEL_NOTICE LOG_NOTICE |
#define | LOGSYS_LEVEL_INFO LOG_INFO |
#define | LOGSYS_LEVEL_DEBUG LOG_DEBUG |
#define | LOGSYS_LEVEL_TRACE LOG_TRACE |
#define | LOGSYS_MAX_SUBSYS_COUNT 32 |
#define | LOGSYS_MAX_SUBSYS_NAMELEN 64 |
#define | LOGSYS_MAX_PERROR_MSG_LEN 128 |
#define | LOGSYS_DEBUG_OFF 0 |
#define | LOGSYS_DEBUG_ON 1 |
#define | LOGSYS_DEBUG_TRACE 2 |
#define | LOGSYS_DECLARE_SYSTEM(name, mode, syslog_facility, syslog_priority) |
The LOGSYS_DECLARE_SYSTEM macro. More... | |
#define | LOGSYS_DECLARE_SUBSYS(subsys) |
The LOGSYS_DECLARE_SUBSYS macro. More... | |
#define | LOGSYS_PERROR(err_num, level, fmt, args...) |
The LOGSYS_PERROR macro. More... | |
#define | log_printf(level, format, args...) qb_log(level, format, ##args) |
#define | ENTER qb_enter |
#define | LEAVE qb_leave |
#define | TRACE1(format, args...) qb_log(LOG_TRACE, "TRACE1:" #format, ##args) |
#define | TRACE2(format, args...) qb_log(LOG_TRACE, "TRACE2:" #format, ##args) |
#define | TRACE3(format, args...) qb_log(LOG_TRACE, "TRACE3:" #format, ##args) |
#define | TRACE4(format, args...) qb_log(LOG_TRACE, "TRACE4:" #format, ##args) |
#define | TRACE5(format, args...) qb_log(LOG_TRACE, "TRACE5:" #format, ##args) |
#define | TRACE6(format, args...) qb_log(LOG_TRACE, "TRACE6:" #format, ##args) |
#define | TRACE7(format, args...) qb_log(LOG_TRACE, "TRACE7:" #format, ##args) |
#define | TRACE8(format, args...) qb_log(LOG_TRACE, "TRACE8:" #format, ##args) |
Functions | |
int | logsys_format_set (const char *format) |
configuration bits that can only be done for the whole system More... | |
char * | logsys_format_get (void) |
logsys_format_get More... | |
int | logsys_config_syslog_facility_set (const char *subsys, unsigned int facility) |
per system/subsystem settings. More... | |
int | logsys_config_syslog_priority_set (const char *subsys, unsigned int priority) |
logsys_config_syslog_priority_set More... | |
int | logsys_config_mode_set (const char *subsys, unsigned int mode) |
logsys_config_mode_set More... | |
unsigned int | logsys_config_mode_get (const char *subsys) |
logsys_config_mode_get More... | |
void | logsys_config_apply (void) |
logsys_config_apply More... | |
int | logsys_config_file_set (const char *subsys, const char **error_string, const char *file) |
to close a logfile, just invoke this function with a NULL file or if you want to change logfile, the old one will be closed for you. More... | |
int | logsys_config_logfile_priority_set (const char *subsys, unsigned int priority) |
logsys_config_logfile_priority_set More... | |
int | logsys_config_debug_set (const char *subsys, unsigned int value) |
enabling debug, disable message priority filtering. More... | |
int | logsys_priority_id_get (const char *name) |
logsys_priority_id_get More... | |
const char * | logsys_priority_name_get (unsigned int priority) |
logsys_priority_name_get More... | |
int | _logsys_system_setup (const char *mainsystem, unsigned int mode, int syslog_facility, int syslog_priority) |
_logsys_system_setup More... | |
void | logsys_system_fini (void) |
logsys_system_fini More... | |
int | _logsys_config_subsys_get (const char *subsys) |
_logsys_config_subsys_get More... | |
int | _logsys_subsys_create (const char *subsys, const char *filename) |
_logsys_subsys_create More... | |
int | logsys_thread_start (void) |
logsys_thread_start More... | |
void | logsys_blackbox_set (int enable) |
void | logsys_blackbox_prefork (void) |
void | logsys_blackbox_postfork (void) |
cs_error_t | logsys_reopen_log_files (void) |
#define ENTER qb_enter |
Definition at line 324 of file logsys.h.
Referenced by sync_abort(), sync_save_transitional(), sync_start(), and votequorum_init().
#define log_printf | ( | level, | |
format, | |||
args... | |||
) | qb_log(level, format, ##args) |
Definition at line 323 of file logsys.h.
Referenced by _corosync_exit_error(), and totemip_parse().
#define LOGSYS_DECLARE_SUBSYS | ( | subsys | ) |
The LOGSYS_DECLARE_SUBSYS macro.
subsys |
#define LOGSYS_DECLARE_SYSTEM | ( | name, | |
mode, | |||
syslog_facility, | |||
syslog_priority | |||
) |
The LOGSYS_DECLARE_SYSTEM macro.
name | |
mode | |
syslog_facility | |
syslog_priority |
#define LOGSYS_LEVEL_CRIT LOG_CRIT |
Definition at line 71 of file logsys.h.
Referenced by totemknet_finalize().
#define LOGSYS_LEVEL_DEBUG LOG_DEBUG |
Definition at line 76 of file logsys.h.
Referenced by totemip_parse(), totemknet_member_add(), totemknet_member_remove(), and totemudpu_member_remove().
#define LOGSYS_LEVEL_ERROR LOG_ERR |
Definition at line 72 of file logsys.h.
Referenced by _corosync_exit_error(), totemknet_finalize(), totemknet_member_add(), totemknet_member_remove(), and totemknet_reconfigure().
#define LOGSYS_LEVEL_NOTICE LOG_NOTICE |
Definition at line 74 of file logsys.h.
Referenced by _corosync_exit_error(), totemudpu_member_add(), and totemudpu_member_remove().
#define LOGSYS_MAX_SUBSYS_COUNT 32 |
Definition at line 85 of file logsys.h.
Referenced by logsys_system_fini(), and logsys_thread_start().
#define LOGSYS_MAX_SUBSYS_NAMELEN 64 |
Definition at line 86 of file logsys.h.
Referenced by _logsys_subsys_create(), and _logsys_system_setup().
#define LOGSYS_PERROR | ( | err_num, | |
level, | |||
fmt, | |||
args... | |||
) |
The LOGSYS_PERROR macro.
err_num | |
level | |
fmt | |
args |
#define TRACE1 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE1:" #format, ##args) |
#define TRACE2 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE2:" #format, ##args) |
#define TRACE3 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE3:" #format, ##args) |
#define TRACE4 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE4:" #format, ##args) |
#define TRACE5 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE5:" #format, ##args) |
#define TRACE6 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE6:" #format, ##args) |
#define TRACE7 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE7:" #format, ##args) |
#define TRACE8 | ( | format, | |
args... | |||
) | qb_log(LOG_TRACE, "TRACE8:" #format, ##args) |
int _logsys_config_subsys_get | ( | const char * | subsys | ) |
_logsys_config_subsys_get
subsys |
Definition at line 467 of file logsys.c.
Referenced by logsys_config_mode_get().
int _logsys_subsys_create | ( | const char * | subsys, |
const char * | filename | ||
) |
_logsys_subsys_create
subsys | |
filename |
Definition at line 433 of file logsys.c.
References LOGSYS_MAX_SUBSYS_NAMELEN.
Referenced by _logsys_system_setup().
int _logsys_system_setup | ( | const char * | mainsystem, |
unsigned int | mode, | ||
int | syslog_facility, | ||
int | syslog_priority | ||
) |
_logsys_system_setup
mainsystem | |
mode | |
syslog_facility | |
syslog_priority |
Definition at line 304 of file logsys.c.
References _logsys_subsys_create(), and LOGSYS_MAX_SUBSYS_NAMELEN.
int logsys_config_debug_set | ( | const char * | subsys, |
unsigned int | value | ||
) |
int logsys_config_file_set | ( | const char * | subsys, |
const char ** | error_string, | ||
const char * | file | ||
) |
int logsys_config_logfile_priority_set | ( | const char * | subsys, |
unsigned int | priority | ||
) |
unsigned int logsys_config_mode_get | ( | const char * | subsys | ) |
logsys_config_mode_get
subsys |
Definition at line 525 of file logsys.c.
References _logsys_config_subsys_get().
int logsys_config_mode_set | ( | const char * | subsys, |
unsigned int | mode | ||
) |
int logsys_config_syslog_facility_set | ( | const char * | subsys, |
unsigned int | facility | ||
) |
int logsys_config_syslog_priority_set | ( | const char * | subsys, |
unsigned int | priority | ||
) |
int logsys_format_set | ( | const char * | format | ) |
int logsys_priority_id_get | ( | const char * | name | ) |
logsys_priority_id_get
name |
Definition at line 830 of file logsys.c.
References syslog_names::c_name, and syslog_names::c_val.
const char* logsys_priority_name_get | ( | unsigned int | priority | ) |
logsys_priority_name_get
priority |
cs_error_t logsys_reopen_log_files | ( | void | ) |
void logsys_system_fini | ( | void | ) |
logsys_system_fini
Definition at line 286 of file logsys.c.
References LOGSYS_MAX_SUBSYS_COUNT.
Referenced by _corosync_exit_error().
int logsys_thread_start | ( | void | ) |
logsys_thread_start
Definition at line 842 of file logsys.c.
References LOGSYS_MAX_SUBSYS_COUNT.