EntropyEngine::Core::Logging::LogEntry
EntropyEngine::Core::Logging::LogEntry
Section titled “EntropyEngine::Core::Logging::LogEntry”A single log entry containing all metadata and message. More…
#include <LogEntry.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| LogEntry(LogLevel lvl, std::string_view cat, std::string msg, const std::source_location & loc =std::source_location::current()) Construct a log entry with current timestamp and thread ID. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| std::chrono::system_clock::time_point | timestamp Timestamp when the log was created. |
| std::thread::id | threadId Thread ID that created the log. |
| std::string | message The actual log message. |
| std::source_location | location Source location information (file:line). |
| LogLevel | level Log severity level. |
| void * | context Optional: Thread-local context (e.g., current work item). |
| std::string_view | category Category/module name (e.g., “WorkGraph”, “Renderer”). |
Detailed Description
Section titled “Detailed Description”struct EntropyEngine::Core::Logging::LogEntry;A single log entry containing all metadata and message.
LogEntry captures comprehensive information about each log event including the message content, timestamp, source location, thread ID, severity level, and category. This provides complete context for debugging and analysis.
Design principles:
- Complete: Contains all necessary debugging context
- Flexible: Sinks determine final formatting and presentation
- Thread-safe: Safe to pass between threads
Formatting is deferred to sinks. The entry captures raw data, allowing background threads to handle formatting operations.
Public Functions Documentation
Section titled “Public Functions Documentation”function LogEntry
Section titled “function LogEntry”inline LogEntry( LogLevel lvl, std::string_view cat, std::string msg, const std::source_location & loc =std::source_location::current())Construct a log entry with current timestamp and thread ID.
Parameters:
- lvl Log severity level
- cat Category/subsystem name
- msg Log message content
- loc Source location (captured automatically)
Automatically captures time, thread ID, and source location using C++20 source_location.
// Location is captured automatically at the call siteLogEntry entry(LogLevel::Error, "Database", "Connection failed");// entry.location contains the file:line informationPublic Attributes Documentation
Section titled “Public Attributes Documentation”variable timestamp
Section titled “variable timestamp”std::chrono::system_clock::time_point timestamp;Timestamp when the log was created.
variable threadId
Section titled “variable threadId”std::thread::id threadId;Thread ID that created the log.
variable message
Section titled “variable message”std::string message;The actual log message.
variable location
Section titled “variable location”std::source_location location;Source location information (file:line).
variable level
Section titled “variable level”LogLevel level;Log severity level.
variable context
Section titled “variable context”void * context = nullptr;Optional: Thread-local context (e.g., current work item).
variable category
Section titled “variable category”std::string_view category;Category/module name (e.g., “WorkGraph”, “Renderer”).
Updated on 2026-01-26 at 17:14:35 -0500