Luna/kernel/include/log/Log.h

23 lines
841 B
C
Raw Normal View History

2022-09-05 14:13:51 +00:00
#pragma once
enum class LogLevel
{
INFO,
WARN,
ERROR
};
namespace KernelLog
{
void log(const char* function, const char* message, LogLevel level);
void logln(const char* function, const char* message, LogLevel level);
}
#define kinternalcall(func, function, message, level) KernelLog::func(function, message, level)
#define kinfo(message) kinternalcall(log, __FUNCTION__, message, LogLevel::INFO)
#define kinfoln(message) kinternalcall(logln, __FUNCTION__, message, LogLevel::INFO)
#define kwarn(message) kinternalcall(log, __FUNCTION__, message, LogLevel::WARN)
#define kwarnln(message) kinternalcall(logln, __FUNCTION__, message, LogLevel::WARN)
#define kerror(message) kinternalcall(log, __FUNCTION__, message, LogLevel::ERROR)
#define kerrorln(message) kinternalcall(logln, __FUNCTION__, message, LogLevel::ERROR)