Skip to content

Commit 99f6111

Browse files
committed
log: add debug log level
1 parent e56c5a5 commit 99f6111

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

include/Log.hpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ namespace log
1313

1414
enum Level
1515
{
16-
Info = 0,
17-
Warn = 1,
18-
Error = 2
16+
Debug = 0,
17+
Info = 1,
18+
Warn = 2,
19+
Error = 3
1920
};
2021

2122
inline const char* level_to_string(const Level level)
2223
{
2324
switch (level)
2425
{
26+
case Level::Debug:
27+
return "DEBUG";
2528
case Level::Info:
2629
return "INFO";
2730
case Level::Warn:
@@ -62,6 +65,12 @@ void log(Level lvl, const char* fmt, Args&&... args)
6265
g_log_function.load(std::memory_order_relaxed)(lvl, s.c_str());
6366
}
6467

68+
template<class... Args>
69+
void debug(const char* fmt, Args&&... args)
70+
{
71+
log(Level::Debug, fmt, std::forward<Args>(args)...);
72+
}
73+
6574
template<class... Args>
6675
void info(const char* fmt, Args&&... args)
6776
{

0 commit comments

Comments
 (0)