version 1.24, 2019/09/06 04:53:27 |
version 1.25, 2020/10/16 13:24:45 |
|
|
SYSLOG_LEVEL_NOT_SET = -1 |
SYSLOG_LEVEL_NOT_SET = -1 |
} LogLevel; |
} LogLevel; |
|
|
typedef void (log_handler_fn)(LogLevel, const char *, void *); |
typedef void (log_handler_fn)(const char *, const char *, int, LogLevel, |
|
const char *, void *); |
|
|
void log_init(char *, LogLevel, SyslogFacility, int); |
void log_init(char *, LogLevel, SyslogFacility, int); |
LogLevel log_level_get(void); |
LogLevel log_level_get(void); |
int log_change_level(LogLevel); |
int log_change_level(LogLevel); |
int log_is_on_stderr(void); |
int log_is_on_stderr(void); |
void log_redirect_stderr_to(const char *); |
void log_redirect_stderr_to(const char *); |
|
void log_verbose_add(const char *); |
|
void log_verbose_reset(void); |
|
|
SyslogFacility log_facility_number(char *); |
SyslogFacility log_facility_number(char *); |
const char * log_facility_name(SyslogFacility); |
const char * log_facility_name(SyslogFacility); |
LogLevel log_level_number(char *); |
LogLevel log_level_number(char *); |
const char * log_level_name(LogLevel); |
const char * log_level_name(LogLevel); |
|
|
void fatal(const char *, ...) __attribute__((noreturn)) |
|
__attribute__((format(printf, 1, 2))); |
|
void error(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
void sigdie(const char *, ...) __attribute__((noreturn)) |
|
__attribute__((format(printf, 1, 2))); |
|
void logdie(const char *, ...) __attribute__((noreturn)) |
|
__attribute__((format(printf, 1, 2))); |
|
void logit(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
void verbose(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
void debug(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
void debug2(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
void debug3(const char *, ...) __attribute__((format(printf, 1, 2))); |
|
|
|
|
|
void set_log_handler(log_handler_fn *, void *); |
void set_log_handler(log_handler_fn *, void *); |
void do_log2(LogLevel, const char *, ...) |
|
__attribute__((format(printf, 2, 3))); |
|
void do_log(LogLevel, const char *, va_list); |
|
void cleanup_exit(int) __attribute__((noreturn)); |
void cleanup_exit(int) __attribute__((noreturn)); |
|
|
|
void sshlog(const char *, const char *, int, int, |
|
LogLevel, const char *, ...) __attribute__((format(printf, 6, 7))); |
|
void sshlogv(const char *, const char *, int, int, |
|
LogLevel, const char *, va_list); |
|
void sshsigdie(const char *, const char *, int, const char *, ...) |
|
__attribute__((noreturn)) __attribute__((format(printf, 4, 5))); |
|
void sshlogdie(const char *, const char *, int, const char *, ...) |
|
__attribute__((noreturn)) __attribute__((format(printf, 4, 5))); |
|
void sshfatal(const char *, const char *, int, const char *, ...) |
|
__attribute__((noreturn)) __attribute__((format(printf, 4, 5))); |
|
|
|
#define ssh_nlog(level, ...) sshlog(__FILE__, __func__, __LINE__, 0, level, __VA_ARGS__) |
|
#define ssh_debug3(...) sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG3, __VA_ARGS__) |
|
#define ssh_debug2(...) sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG2, __VA_ARGS__) |
|
#define ssh_debug(...) sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_DEBUG1, __VA_ARGS__) |
|
#define ssh_verbose(...) sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_VERBOSE, __VA_ARGS__) |
|
#define ssh_log(...) sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_INFO, __VA_ARGS__) |
|
#define ssh_error(...) sshlog(__FILE__, __func__, __LINE__, 0, SYSLOG_LEVEL_ERROR, __VA_ARGS__) |
|
#define ssh_fatal(...) sshfatal(__FILE__, __func__, __LINE__, __VA_ARGS__) |
|
#define ssh_logdie(...) sshlogdie(__FILE__, __func__, __LINE__, __VA_ARGS__) |
|
#define ssh_sigdie(...) sshsigdie(__FILE__, __func__, __LINE__, __VA_ARGS__) |
|
|
|
#define debug ssh_debug |
|
#define debug1 ssh_debug1 |
|
#define debug2 ssh_debug2 |
|
#define debug3 ssh_debug3 |
|
#define error ssh_error |
|
#define logit ssh_log |
|
#define verbose ssh_verbose |
|
#define fatal ssh_fatal |
|
#define logdie ssh_logdie |
|
#define sigdie ssh_sigdie |
|
#define do_log2 ssh_nlog |
|
|
#endif |
#endif |