31 lines
999 B
C
31 lines
999 B
C
#ifndef MANGO_LOG_H_
|
|
#define MANGO_LOG_H_
|
|
|
|
#include <mango/status.h>
|
|
|
|
#undef TRACE
|
|
|
|
extern kern_status_t kern_log(const char *s);
|
|
|
|
#define kern_logf(...) \
|
|
do { \
|
|
char s[128]; \
|
|
snprintf(s, sizeof s, __VA_ARGS__); \
|
|
kern_log(s); \
|
|
} while (0)
|
|
|
|
#ifdef TRACE
|
|
#define kern_trace(...) kern_log(__VA_ARGS__)
|
|
#define kern_tracef(...) \
|
|
do { \
|
|
char s[128]; \
|
|
snprintf(s, sizeof s, __VA_ARGS__); \
|
|
kern_log(s); \
|
|
} while (0)
|
|
#else
|
|
#define kern_trace(...)
|
|
#define kern_tracef(...)
|
|
#endif
|
|
|
|
#endif
|