2023-08-26 10:43:44 +00:00
|
|
|
/**
|
|
|
|
* @file DebugLog.h
|
|
|
|
* @author apio (cloudapio.eu)
|
|
|
|
* @brief Debug logging for platform-agnostic functions.
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2022-2023, the Luna authors.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-12-22 17:00:35 +00:00
|
|
|
#pragma once
|
|
|
|
#include <luna/Attributes.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2023-08-26 10:43:44 +00:00
|
|
|
/**
|
|
|
|
* @brief The actual debug log implementation. This must be provided by the platform or user.
|
|
|
|
*
|
|
|
|
* In the kernel, the implementation is located in src/Log.cpp.
|
|
|
|
* For POSIX systems, libluna provides an implementation in src/ImplPOSIX.cpp.
|
|
|
|
*
|
|
|
|
* The printed message must be followed by an implicit newline.
|
|
|
|
*
|
|
|
|
* @param format The format string (in the style of printf).
|
|
|
|
* @param ap The variadic argument list.
|
|
|
|
*/
|
2022-12-22 17:00:35 +00:00
|
|
|
extern void debug_log_impl(const char* format, va_list ap);
|
|
|
|
|
2023-08-26 10:43:44 +00:00
|
|
|
/**
|
|
|
|
* @brief Log a formatted message.
|
|
|
|
*
|
|
|
|
* @param format The format string (in the style of printf).
|
|
|
|
* @param ... The format arguments.
|
|
|
|
*/
|
2023-01-02 12:07:29 +00:00
|
|
|
void dbgln(const char* format, ...) _format(1, 2);
|