Files
my-os-project2/ulib/log.h
2025-09-27 15:16:26 +02:00

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_