2011-12-15 03:47:30 +04:00
|
|
|
#ifndef LOGGING_H
|
|
|
|
#define LOGGING_H
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
INFO = 0, /* Unimportant */
|
|
|
|
NOTICE, /* Important, but not bad */
|
|
|
|
WARNING, /* Not what was expected, but still okay */
|
|
|
|
ERROR, /* This is bad... */
|
2013-06-06 10:10:36 +04:00
|
|
|
CRITICAL, /* Shit */
|
|
|
|
INSANE
|
2011-12-15 03:47:30 +04:00
|
|
|
} log_type_t;
|
|
|
|
|
2012-09-04 09:35:11 +04:00
|
|
|
log_type_t debug_level;
|
|
|
|
void _debug_print(char * title, int line_no, log_type_t level, char *fmt, ...);
|
|
|
|
|
|
|
|
#ifndef MODULE_NAME
|
|
|
|
#define MODULE_NAME __FILE__
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef QUIET
|
|
|
|
#define debug_print(level, ...) _debug_print(MODULE_NAME, __LINE__, level, __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define debug_print(level, ...)
|
|
|
|
#endif
|
|
|
|
|
2011-12-15 03:47:30 +04:00
|
|
|
#endif
|