OpenVPN
|
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | M_DEBUG_LEVEL (0x0F) /* debug level mask */ |
#define | M_FATAL (1<<4) /* exit program */ |
#define | M_NONFATAL (1<<5) /* non-fatal error */ |
#define | M_WARN (1<<6) /* call syslog with LOG_WARNING */ |
#define | M_DEBUG (1<<7) |
#define | M_ERRNO (1<<8) /* show errno description */ |
#define | M_NOMUTE (1<<11) /* don't do mute processing */ |
#define | M_NOPREFIX (1<<12) /* don't show date/time prefix */ |
#define | M_USAGE_SMALL (1<<13) /* fatal options error, call usage_small */ |
#define | M_MSG_VIRT_OUT (1<<14) /* output message through msg_status_output callback */ |
#define | M_OPTERR (1<<15) /* print "Options error:" prefix */ |
#define | M_NOLF (1<<16) /* don't print new line */ |
#define | M_NOIPREFIX (1<<17) /* don't print instance prefix */ |
#define | M_ERR (M_FATAL | M_ERRNO) |
#define | M_USAGE (M_USAGE_SMALL | M_NOPREFIX | M_OPTERR) |
#define | M_CLIENT (M_MSG_VIRT_OUT | M_NOMUTE | M_NOIPREFIX) |
#define | EXIT_FATAL(flags) do { if ((flags) & M_FATAL) {_exit(1);}} while (false) |
#define | msg(flags, ...) do { if (msg_test(flags)) {x_msg((flags), __VA_ARGS__);} EXIT_FATAL(flags); } while (false) |
#define | dmsg(flags, ...) |
Functions | |
bool | dont_mute (unsigned int flags) |
Check muting filter. More... | |
void | x_msg (const unsigned int flags, const char *format,...) |
void | x_msg_va (const unsigned int flags, const char *format, va_list arglist) |
static bool | check_debug_level (unsigned int level) |
static bool | msg_test (unsigned int flags) |
Return true if flags represent and enabled, not muted log level. More... | |
Variables | |
unsigned int | x_debug_level |
int | x_msg_line_num |
#define EXIT_FATAL | ( | flags | ) | do { if ((flags) & M_FATAL) {_exit(1);}} while (false) |
#define M_CLIENT (M_MSG_VIRT_OUT | M_NOMUTE | M_NOIPREFIX) |
#define M_MSG_VIRT_OUT (1<<14) /* output message through msg_status_output callback */ |
#define M_NOIPREFIX (1<<17) /* don't print instance prefix */ |
#define M_USAGE (M_USAGE_SMALL | M_NOPREFIX | M_OPTERR) |
#define M_USAGE_SMALL (1<<13) /* fatal options error, call usage_small */ |
#define msg | ( | flags, | |
... | |||
) | do { if (msg_test(flags)) {x_msg((flags), __VA_ARGS__);} EXIT_FATAL(flags); } while (false) |
|
inlinestatic |
Definition at line 84 of file error.h.
References M_DEBUG_LEVEL, and x_debug_level.
Referenced by msg_test().
bool dont_mute | ( | unsigned int | flags | ) |
Check muting filter.
Definition at line 407 of file error.c.
References DECODE_MUTE_LEVEL, M_INFO, M_NOMUTE, msg, mute_category, mute_count, and mute_cutoff.
Referenced by x_msg_va().
|
inlinestatic |
Return true if flags represent and enabled, not muted log level.
Definition at line 91 of file error.h.
References check_debug_level(), and dont_mute().
void x_msg | ( | const unsigned int | flags, |
const char * | format, | ||
... | |||
) |
Definition at line 213 of file error.c.
References x_msg_va().
void x_msg_va | ( | const unsigned int | flags, |
const char * | format, | ||
va_list | arglist | ||
) |
Definition at line 234 of file error.c.
References check_debug_level(), DEBUG_LEVEL_USEC_TIME, dont_mute(), ERR_BUF_SIZE, ERROR_MSICA, ERROR_MSICA_ERRNO, fatal_error_triggered, forked, gc_free(), gc_init(), gc_malloc(), openvpnmsica_thread_data::hInstall, M_ERRNO, M_FATAL, M_INFO, M_MSG_VIRT_OUT, M_NOIPREFIX, M_NOLF, M_NONFATAL, M_NOPREFIX, M_OPTERR, M_USAGE_SMALL, M_WARN, machine_readable_output, msg, msg_fp(), msg_get_prefix(), msg_get_virtual_output(), msg_test(), openvpn_errno_maybe_crt(), openvpn_exit(), OPENVPN_EXIT_STATUS_ERROR, openvpn_strerror(), openvpnmsica_thread_data_idx, PRIsLPTSTR, std_redir, suppress_timestamps, SWAP, time_string(), usage_small(), use_syslog, virtual_output_print(), and x_msg_line_num.
Referenced by plugin_vlog(), and x_msg().
unsigned int x_debug_level |
Definition at line 52 of file error.c.
Referenced by error_reset(), get_debug_level(), mock_set_debug_level(), and set_debug_level().
int x_msg_line_num |
Definition at line 210 of file error.c.
Referenced by x_msg_va().