|
corosync
2.4.3
|
#include <stdarg.h>#include <stdlib.h>#include <syslog.h>#include <pthread.h>#include <limits.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_SECTION |
| #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... | |
| #define ENTER qb_enter |
Definition at line 320 of file logsys.h.
Referenced by sync_abort(), sync_memb_list_abort(), sync_memb_list_determine(), sync_save_transitional(), sync_start(), and votequorum_init().
| #define log_printf | ( | level, | |
| format, | |||
| args... | |||
| ) | qb_log(level, format, ##args) |
Definition at line 319 of file logsys.h.
Referenced by _corosync_exit_error().
| #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_DEBUG LOG_DEBUG |
Definition at line 74 of file logsys.h.
Referenced by totemudpu_member_remove(), and totemudpu_member_set_active().
| #define LOGSYS_LEVEL_ERROR LOG_ERR |
Definition at line 70 of file logsys.h.
Referenced by _corosync_exit_error().
| #define LOGSYS_LEVEL_NOTICE LOG_NOTICE |
Definition at line 72 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 83 of file logsys.h.
Referenced by logsys_config_apply(), logsys_system_fini(), and logsys_thread_start().
| #define LOGSYS_MAX_SUBSYS_NAMELEN 64 |
Definition at line 84 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 470 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 436 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 303 of file logsys.c.
References _logsys_subsys_create(), and LOGSYS_MAX_SUBSYS_NAMELEN.
| void logsys_config_apply | ( | void | ) |
| 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 528 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 808 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 |
| void logsys_system_fini | ( | void | ) |
logsys_system_fini
Definition at line 285 of file logsys.c.
References LOGSYS_MAX_SUBSYS_COUNT.
Referenced by _corosync_exit_error(), and main().
| int logsys_thread_start | ( | void | ) |
logsys_thread_start
Definition at line 820 of file logsys.c.
References LOGSYS_MAX_SUBSYS_COUNT.
1.8.13