aboutsummaryrefslogtreecommitdiff
path: root/include/log.h
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-08-27 15:56:12 +0000
committerKenny Levinsen <kl@kl.wtf>2020-08-28 01:21:57 +0200
commita254fe3692e63f92aa710310ba8113373180448c (patch)
treee241010ffbfd6f8c3aefd31b270ef4c6bd8b1d59 /include/log.h
parentab4b961492ef91a9e2b456b4e2812eaad9994c3a (diff)
Rename enum log_level to libseat_log_level
This is preparatory work for exposing a public function to set libseat's log handler.
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