2019-11-29 01:52:56 -07:00
|
|
|
#ifndef __LOG_H_INCLUDED
|
|
|
|
#define __LOG_H_INCLUDED
|
|
|
|
|
|
|
|
#define LFATAL 0
|
|
|
|
#define LERROR 1
|
|
|
|
#define LWARN 2
|
|
|
|
#define LINFO 3
|
|
|
|
#define LDEBUG 4
|
|
|
|
|
2019-11-29 02:18:02 -07:00
|
|
|
extern void Log(int level, const char *format, ...);
|
2019-12-06 23:46:21 -07:00
|
|
|
extern void Log_assert_failed(const char *test, const char *file, int line);
|
|
|
|
|
|
|
|
#define THIS_FILE __FILE__
|
|
|
|
#define DECLARE_THIS_FILE() static const char THIS_FILE[] = __FILE__
|
|
|
|
|
|
|
|
#ifdef DEBUG_ASSERT
|
|
|
|
#define ASSERT(x) ((x) ? (void)0 : Log_assert_failed(#x, THIS_FILE, __LINE__))
|
|
|
|
#define VERIFY(x) ASSERT(x)
|
|
|
|
#else
|
|
|
|
#define ASSERT(x) ((void)0)
|
|
|
|
#define VERIFY(x) ((void)(x))
|
|
|
|
#endif
|
2019-11-29 01:52:56 -07:00
|
|
|
|
|
|
|
#endif /* __LOG_H_INCLUDED */
|