Skip to content

ludus::foundation::logging

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/foundation/logging/include/ludus/foundation/logging/category.hpp

Enumerations

LogLevel

enum class LogLevel : uint8
Severity levels, ordered from most to least verbose.
The underlying integer ordering is load-bearing: runtime and compile-time filtering both rely on level >= threshold comparisons, so the numeric order must never change without updating the filtering logic and the compiled-level macros.

Related types: uint8

Trace

Trace = 0

Debug

Debug = 1

Info

Info = 2

Warning

Warning = 3

Error

Error = 4

Fatal

Fatal = 5

Declared in modules/foundation/logging/include/ludus/foundation/logging/level.hpp

DeliveryStatus

enum class DeliveryStatus : uint8
Result of an explicit direct (debugger-critical) delivery.
It reports whether the record reached a healthy direct output endpoint BEFORE the call returned, so a caller/tool can inspect it before hitting a breakpoint (requirements R27 path 2, R28). Delivered means "handed to a selected direct endpoint", never "a GUI painted it".

Related types: uint8

Delivered

Delivered

Filtered

Filtered

NoEndpoint

NoEndpoint

Declared in modules/foundation/logging/include/ludus/foundation/logging/log.hpp

ArgTag

enum class ArgTag : uint8
Argument tag for the narrow typed grammar.
Kept in the public header because packing happens at the call site; the values are lightweight scalars/views.

Related types: uint8

StrView

StrView

Bool

Bool

I64

I64

U64

U64

Ptr

Ptr

F64

F64

Declared in modules/foundation/logging/include/ludus/foundation/logging/log_format.hpp

LogMode

enum class LogMode : uint8
Execution strategy for the logging backend.
Synchronous is the corrected, serialized backend used by tools/tests; Asynchronous selects the bounded MPSC backend. The EFFECTIVE mode is reported by Initialize(); there is no live SetMode (a live transition would require draining and transferring sink ownership). See requirements R41.

Related types: uint8

Synchronous

Synchronous

Asynchronous

Asynchronous

Declared in modules/foundation/logging/include/ludus/foundation/logging/log_system.hpp

LogStatus

enum class LogStatus : uint8
Result of Initialize(): status plus the mode actually in effect.
A caller can observe whether a requested Asynchronous mode was honored or fell back to Synchronous / was rejected as Unsupported (requirements R41, R28).

Related types: uint8

Ok

Ok

NotInitialized

NotInitialized

AlreadyInitialized

AlreadyInitialized

Unsupported

Unsupported

Degraded

Degraded

TimedOut

TimedOut

Incomplete

Incomplete

SinkFailed

SinkFailed

Filtered

Filtered

Declared in modules/foundation/logging/include/ludus/foundation/logging/log_system.hpp

FlushKind

enum class FlushKind : uint8
Flush strength.
Visible pushes selected local sink buffers to the OS; Durable additionally requests a platform durable-file operation (fsync/FlushFileBuffers) for selected files. Neither guarantees remote reception or hardware-failure survival (requirements R28, R46).

Related types: uint8

Visible

Visible

Durable

Durable

Declared in modules/foundation/logging/include/ludus/foundation/logging/log_system.hpp

Constants and variables

LOG_CORE

constexpr LogCategory ludus::foundation::logging::LOG_CORE {"Core"}

Related types: LogCategory

Declared in modules/foundation/logging/include/ludus/foundation/logging/category.hpp

LOG_TEMP

constexpr LogCategory ludus::foundation::logging::LOG_TEMP {"Temp"}

Related types: LogCategory

Declared in modules/foundation/logging/include/ludus/foundation/logging/category.hpp

Functions

HashLogCategory

constexpr uint32 ludus::foundation::logging::HashLogCategory(std::string_view name) noexcept
Compile-time FNV-1a hash used to derive a stable 32-bit category id from the category name.
Runtime filtering compares these integer ids rather than performing a string-map lookup on every logging call (.kiro/specs/logging-redesign/design.md section 3).

Related types: uint32

Declared in modules/foundation/logging/include/ludus/foundation/logging/category.hpp

ToPaddedString

constexpr std::string_view ludus::foundation::logging::ToPaddedString(LogLevel level) noexcept
Fixed-width, right-padded five-character label used by the console and file sinks (e.g. "INFO ", "TRACE").
Returns "?????" for out-of-range values so a corrupted record can never index out of bounds.

Related types: LogLevel

Declared in modules/foundation/logging/include/ludus/foundation/logging/level.hpp

ToString

constexpr std::string_view ludus::foundation::logging::ToString(LogLevel level) noexcept

Related types: LogLevel

Declared in modules/foundation/logging/include/ludus/foundation/logging/level.hpp

SetCurrentThreadName

void ludus::foundation::logging::SetCurrentThreadName(std::string_view name)
Assign a human-readable name to the calling thread.
Log output prefers this name (e.g. "[Render]") over an opaque numeric id. Safe to call before Initialize(); the name is stored in thread-local state.

Declared in modules/foundation/logging/include/ludus/foundation/logging/log.hpp

ShouldLog

bool ludus::foundation::logging::ShouldLog(LogLevel level, LogCategory category) noexcept
Cheap, lock-free runtime predicate used by the macros to skip work when a record would be filtered out.
It performs only scalar atomic loads: no lock, no allocation, no hash-map lookup, no timestamp, no argument evaluation (requirements R13). Safe to call before Initialize().

Related types: LogLevel · LogCategory

Declared in modules/foundation/logging/include/ludus/foundation/logging/log.hpp