Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Docs/LoggingSinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# DraconicEngine Logging Sinks

The logging module in DraconicEngine utilizes an asynchronous sink architecture. Sinks are responsible for formatting and routing `LogMessage` structs to their final destination.

Currently, the engine provides three native sinks, all implementing the `ILogSink` interface:

## 1. `ConsoleSink`
Outputs standard formatted logs directly to `stdout`.
* **Usage:** Best for local debugging and immediate developer feedback inside IDE terminals.
* **Performance:** Uses high-speed async queuing, but `stdout` blocking can occur depending on the OS terminal implementation.

## 2. `FileSink`
Appends incoming log messages to a specified flat file path.
* **Usage:** Standard, long-running application logs where size constraints aren't an immediate concern.
* **Internal:** Implemented using the PIMPL idiom to avoid leaking `<fstream>` into the module interface.

## 3. `RollingFileSink`
Behaves like `FileSink`, but intelligently rolls the log to a new file when a predefined size limit (`m_max_file_size`) is hit.
* **Usage:** Production builds and dedicated servers where you need to prevent log files from infinitely ballooning and consuming disk space.
* **Formatting:** Appends a timestamp (`%Y%m%d_%H%M%S`) and an atomic sequence number to the new filename.
2 changes: 1 addition & 1 deletion Engine/cpp/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_modules_library(rendering)
add_modules_library(scene)

target_link_libraries(platform PUBLIC platform_impl)
target_link_libraries(core PUBLIC definitions math io memory)
target_link_libraries(core PUBLIC definitions math io memory logging)
target_link_libraries(input PRIVATE SDL3::SDL3-static platform core)
target_link_libraries(rendering PUBLIC rhi rendergraph mesh material quad_renderer renderer)
target_link_libraries(scene PUBLIC renderable transform_component camera)
2 changes: 2 additions & 0 deletions Engine/cpp/runtime/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ add_modules_library(definitions PIC)
add_modules_library(math)
add_modules_library(io)
add_modules_library(memory)
add_modules_library(logging)

target_link_libraries(math PUBLIC definitions bx)
target_link_libraries(io PUBLIC definitions stb_image)
target_link_libraries(memory PUBLIC definitions math)
target_link_libraries(logging PUBLIC definitions)
1 change: 1 addition & 0 deletions Engine/cpp/runtime/core/core.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export import core.defs;
export import core.math;
export import core.memory;
export import core.io;
export import core.logging;
2 changes: 1 addition & 1 deletion Engine/cpp/runtime/core/io/image_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module core.io.image_loader;

import core.stdtypes;

// TODO: I'm too lazy to write code so we need somethin' better
// TODO: I'm too lazy to write code so we need somethin' better (AR-DEV-1)
Comment thread
Shakai-Dev marked this conversation as resolved.

namespace draco::core::io::image_loader
{
Expand Down
Loading
Loading