Add dbgln() for the luna library
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2022-12-22 18:00:35 +01:00
parent a3595e71a9
commit 9afaad8fed
Signed by: apio
GPG Key ID: B8A7D06E42258954
4 changed files with 23 additions and 0 deletions

View File

@ -87,6 +87,12 @@ void log(LogLevel level, const char* format, ...)
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)
{
g_debug_enabled = enable_debug;

View File

@ -12,6 +12,7 @@ set(FREESTANDING_SOURCES
src/OwnedStringView.cpp
src/Utf8.cpp
src/TarStream.cpp
src/DebugLog.cpp
)
set(SOURCES

View 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
View 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);
}