Add dbgln() for the luna library
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a3595e71a9
commit
9afaad8fed
@ -87,6 +87,12 @@ void log(LogLevel level, const char* format, ...)
|
|||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for luna/DebugLog.h
|
||||||
|
void debug_log_impl(const char* format, va_list ap)
|
||||||
|
{
|
||||||
|
vlog(LogLevel::Debug, format, ap);
|
||||||
|
}
|
||||||
|
|
||||||
void setup_log(bool enable_debug, bool enable_serial, bool enable_text_console)
|
void setup_log(bool enable_debug, bool enable_serial, bool enable_text_console)
|
||||||
{
|
{
|
||||||
g_debug_enabled = enable_debug;
|
g_debug_enabled = enable_debug;
|
||||||
|
@ -12,6 +12,7 @@ set(FREESTANDING_SOURCES
|
|||||||
src/OwnedStringView.cpp
|
src/OwnedStringView.cpp
|
||||||
src/Utf8.cpp
|
src/Utf8.cpp
|
||||||
src/TarStream.cpp
|
src/TarStream.cpp
|
||||||
|
src/DebugLog.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
|
7
luna/include/luna/DebugLog.h
Normal file
7
luna/include/luna/DebugLog.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <luna/Attributes.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
extern void debug_log_impl(const char* format, va_list ap);
|
||||||
|
|
||||||
|
void dbgln(const char* format, ...) _format(1, 2);
|
9
luna/src/DebugLog.cpp
Normal file
9
luna/src/DebugLog.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <luna/DebugLog.h>
|
||||||
|
|
||||||
|
void dbgln(const char* format, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, format);
|
||||||
|
debug_log_impl(format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user