49 lines
1.0 KiB
C
49 lines
1.0 KiB
C
#ifndef __SMCC_LEXER_LOG_H__
|
|
#define __SMCC_LEXER_LOG_H__
|
|
|
|
#include <libcore.h>
|
|
|
|
#ifndef LEX_LOG_LEVEL
|
|
#define LEX_LOG_LEVEL 4
|
|
#endif
|
|
|
|
#if LEX_LOG_LEVEL <= 1
|
|
#define LEX_NOTSET(fmt, ...) MLOG_NOTSET(&__smcc_lexer_log, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#define LEX_NOTSET(fmt, ...)
|
|
#endif
|
|
|
|
#if LEX_LOG_LEVEL <= 2
|
|
#define LEX_DEBUG(fmt, ...) MLOG_DEBUG(&__smcc_lexer_log, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#define LEX_DEBUG(fmt, ...)
|
|
#endif
|
|
|
|
#if LEX_LOG_LEVEL <= 3
|
|
#define LEX_INFO(fmt, ...) MLOG_INFO(&__smcc_lexer_log, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#define LEX_INFO(fmt, ...)
|
|
#endif
|
|
|
|
#if LEX_LOG_LEVEL <= 4
|
|
#define LEX_WARN(fmt, ...) MLOG_WARN(&__smcc_lexer_log, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#define LEX_WARN(fmt, ...)
|
|
#endif
|
|
|
|
#if LEX_LOG_LEVEL <= 5
|
|
#define LEX_ERROR(fmt, ...) MLOG_ERROR(&__smcc_lexer_log, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#define LEX_ERROR(fmt, ...)
|
|
#endif
|
|
|
|
#if LEX_LOG_LEVEL <= 6
|
|
#define LEX_FATAL(fmt, ...) MLOG_FATAL(&__smcc_lexer_log, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#define LEX_FATAL(fmt, ...)
|
|
#endif
|
|
|
|
extern logger_t __smcc_lexer_log;
|
|
|
|
#endif // __SMCC_LEXER_LOG_H__
|