Luna/kernel/include/log/Log.h
2022-09-05 16:13:51 +02:00

23 lines
841 B
C++

#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)