Imported Upstream version 2.0.90
[platform/upstream/kbd.git] / src / libkeymap / keymap / logging.h
1 /**
2  * @file logging.h
3  * @brief Functions for logging.
4  */
5 #ifndef LK_LOGGING_H
6 #define LK_LOGGING_H
7
8 #include <syslog.h>
9 #include <keymap/context.h>
10
11 #ifndef __GNUC__
12 #define __attribute__(x) /*NOTHING*/
13 #endif
14
15 typedef void (*lk_logger_t)(void *, int, const char *, int, const char *, const char *, va_list) __attribute__((format(printf, 6, 0)));
16
17 /**
18  * Logging function which uses @ref lk_ctx::log_fn "log_fn" and
19  * @ref lk_ctx::log_data "log_data" to write log messages.
20  * @param ctx is a keymap library context.
21  * @param priority indicates the priority.
22  */
23 void
24 __attribute__((format(printf, 6, 7)))
25 lk_log(struct lk_ctx *ctx, int priority,
26        const char *file, int line, const char *fn,
27        const char *fmt, ...);
28
29 #endif /* LK_LOGGING_H */