Consistency fixes
[notion.git] / ioncore / log.h
blob74e5c24b69abc055dbcfd975db7478910787417f
1 /*
2 * notion/ioncore/log.h
4 * Copyright (c) the Notion team 2013.
6 * See the included file LICENSE for details.
7 */
9 #ifndef NOTION_IONCORE_LOG_H
11 typedef enum{
12 DEBUG = 0, /** Not usually shown, but can be useful for debugging */
13 INFO, /** Usually shown, does not necessarily indicate an error */
14 WARN, /** Usually shown, indicates a likely but non-fatal misconfiguration/error */
15 ERROR /** Shown, indicates an error */
16 } LogLevel;
19 typedef enum{
20 GENERAL,
21 FONT,
22 RANDR,
23 FOCUS,
24 VALGRIND /* Useful while debugging valgrind warnings */
25 } LogCategory;
28 /** When logging from C code, don't use this function directly, use the LOG macro instead */
29 extern void log_message(LogLevel level, LogCategory category, const char *file, const int line, const char* function, const char* message, ...);
31 #if __STDC_VERSION__ >= 199901L
32 #define LOG(level, category, ...) log_message(level, category, __FILE__, __LINE__, __func__, __VA_ARGS__)
33 #else
34 extern void LOG(LogLevel level, LogCategory category, const char* message, ...);
35 #endif
37 #endif /*NOTION_IONCORE_LOG_H*/