#pragma once #include #include #include #include #include #include #include namespace Void::Logging { enum class Kind { Message, ScopeEnter, ScopeExit }; /// A single, immutable log record produced by Logger and handed to /// write() / on_flush(). All fields are populated by Logger before /// dispatch; derived sinks treat Entry as read-only. struct Entry { Kind kind{Kind::Message}; Level level{Level::Debug}; /// Human-readable text. For ScopeEnter/ScopeExit entries this /// is the scope name. std::string message{}; /// Wall-clock time at the moment log() / scope() was called. std::chrono::system_clock::time_point timestamp{ std::chrono::system_clock::now()}; /// Caller site captured automatically via /// std::source_location::current(). std::source_location location{}; /// OS thread that produced this entry. std::thread::id thread_id{std::this_thread::get_id()}; /// Frozen snapshot of the thread-local ScopedContext stack at log /// time. std::vector scopes{}; /// Structured key/value fields attached to this entry. std::vector> fields{}; /// True when explicit oversize-truncation policy clipped message, /// fields, scopes, or formatted payload. bool truncated{false}; }; } // namespace Void::Logging