aboutsummaryrefslogtreecommitdiff
path: root/include/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/include/log.h b/include/log.h
index 80b9864..ff354f8 100644
--- a/include/log.h
+++ b/include/log.h
@@ -15,37 +15,41 @@
#define __FILENAME__ __FILE__
#endif
-#define log_infof(fmt, ...) \
- _logf(LOGLEVEL_INFO, "[%s:%d] %s: " fmt, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
+#define log_infof(fmt, ...) \
+ _logf(LIBSEAT_LOG_LEVEL_INFO, "[%s:%d] %s: " fmt, __FILENAME__, __LINE__, __func__, \
+ __VA_ARGS__)
-#define log_info(str) _logf(LOGLEVEL_INFO, "[%s:%d] %s: %s", __FILENAME__, __LINE__, __func__, str)
+#define log_info(str) \
+ _logf(LIBSEAT_LOG_LEVEL_INFO, "[%s:%d] %s: %s", __FILENAME__, __LINE__, __func__, str)
-#define log_errorf(fmt, ...) \
- _logf(LOGLEVEL_ERROR, "[%s:%d] %s: " fmt, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
+#define log_errorf(fmt, ...) \
+ _logf(LIBSEAT_LOG_LEVEL_ERROR, "[%s:%d] %s: " fmt, __FILENAME__, __LINE__, __func__, \
+ __VA_ARGS__)
#define log_error(str) \
- _logf(LOGLEVEL_ERROR, "[%s:%d] %s: %s", __FILENAME__, __LINE__, __func__, str)
+ _logf(LIBSEAT_LOG_LEVEL_ERROR, "[%s:%d] %s: %s", __FILENAME__, __LINE__, __func__, str)
#ifdef DEBUG
-#define log_debugf(fmt, ...) \
- _logf(LOGLEVEL_DEBUG, "[%s:%d] %s: " fmt, __FILENAME__, __LINE__, __func__, __VA_ARGS__)
+#define log_debugf(fmt, ...) \
+ _logf(LIBSEAT_LOG_LEVEL_DEBUG, "[%s:%d] %s: " fmt, __FILENAME__, __LINE__, __func__, \
+ __VA_ARGS__)
#define log_debug(str) \
- _logf(LOGLEVEL_DEBUG, "[%s:%d] %s: %s", __FILENAME__, __LINE__, __func__, str)
+ _logf(LIBSEAT_LOG_LEVEL_DEBUG, "[%s:%d] %s: %s", __FILENAME__, __LINE__, __func__, str)
#else
#define log_debugf(fmt, ...)
#define log_debug(str)
#endif
-enum log_level {
- LOGLEVEL_SILENT = 0,
- LOGLEVEL_ERROR = 1,
- LOGLEVEL_INFO = 2,
- LOGLEVEL_DEBUG = 3,
- LOGLEVEL_LAST,
+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 log_level level);
-void _logf(enum log_level level, const char *fmt, ...) ATTRIB_PRINTF(2, 3);
+void log_init(enum libseat_log_level level);
+void _logf(enum libseat_log_level level, const char *fmt, ...) ATTRIB_PRINTF(2, 3);
#endif