Simple lua repl for testing
[notion.git] / ioncore / log.h
blobcb0be30367276e902c5223ec2adff0ff0503eab7
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 } LogCategory;
25 /** When logging from C code, don't use this function directly, use the LOG macro instead */
26 extern void log_message(LogLevel level, LogCategory category, const char *file, const int line, const char* function, const char* message, ...);
28 #if __STDC_VERSION__ >= 199901L
29 #define LOG(level, category, ...) log_message(level, category, __FILE__, __LINE__, __func__, __VA_ARGS__)
30 #else
31 extern void LOG(LogLevel level, LogCategory category, const char* message, ...);
32 #endif
34 #endif /*NOTION_IONCORE_LOG_H*/