19 lines
323 B
C
19 lines
323 B
C
#ifndef ULIB_LOG_H_
|
|
#define ULIB_LOG_H_
|
|
|
|
#include <uprintf.h>
|
|
#include <write/write.h>
|
|
|
|
enum {
|
|
LOG_ERR,
|
|
LOG_DBG,
|
|
LOG_INF,
|
|
LOG_WRN,
|
|
};
|
|
|
|
static const char *_LOG_STR[] = { "ERROR", "DEBUG", "INFO", "WARNING" };
|
|
|
|
#define LOG(mode, fmt, ...) writefmt("{s}: "fmt, _LOG_STR[(mode)], ##__VA_ARGS__);
|
|
|
|
#endif // ULIB_LOG_H_
|