Introduce libseat_set_log_handler
This allows libseat users to register a custom logging function.
This commit is contained in:
parent
a254fe3692
commit
47d4b43f1a
3 changed files with 60 additions and 26 deletions
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "libseat.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
|
||||
#else
|
||||
|
@ -41,14 +43,6 @@
|
|||
#define log_debug(str)
|
||||
#endif
|
||||
|
||||
enum libseat_log_level {
|
||||
LIBSEAT_LOG_LEVEL_SILENT = 0,
|
||||
LIBSEAT_LOG_LEVEL_ERROR = 1,
|
||||
LIBSEAT_LOG_LEVEL_INFO = 2,
|
||||
LIBSEAT_LOG_LEVEL_DEBUG = 3,
|
||||
LIBSEAT_LOG_LEVEL_LAST,
|
||||
};
|
||||
|
||||
void log_init(enum libseat_log_level level);
|
||||
void _logf(enum libseat_log_level level, const char *fmt, ...) ATTRIB_PRINTF(2, 3);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue