feat(Log): harden LogState facade, bounded Logger delivery/tickets/quarantine, file sync/reopen, redaction, and separate LogConfig (M-LOG-01..05)
This commit is contained in:
1 parent
18a623aa62
commit
a74a402938
23 files changed
+2656
-1197
No files matched your search
@@ -11,14 +11,6 @@
|
||||
|
||||
namespace Void::Logging
|
||||
{
|
||||
/// Distinguishes regular messages from scope boundary markers.
|
||||
///
|
||||
/// Sinks may use Kind to render scope entries differently —
|
||||
/// e.g. with indentation, brackets, or a dedicated colour.
|
||||
///
|
||||
/// Message — a regular log record
|
||||
/// ScopeEnter — emitted when a named scope opens (scope() call)
|
||||
/// ScopeExit — emitted when a named scope closes (RAII destructor)
|
||||
enum class Kind { Message, ScopeEnter, ScopeExit };
|
||||
|
||||
/// A single, immutable log record produced by Logger and handed to
|
||||
@@ -44,18 +36,15 @@ namespace Void::Logging
|
||||
std::thread::id thread_id{std::this_thread::get_id()};
|
||||
|
||||
/// Frozen snapshot of the thread-local ScopedContext stack at log
|
||||
/// time. Ordered outermost → innermost (index 0 is the root
|
||||
/// scope). For ScopeEnter this already includes the new scope as
|
||||
/// the last element; for ScopeExit it reflects the stack *before*
|
||||
/// the pop.
|
||||
/// time.
|
||||
std::vector<std::string> scopes{};
|
||||
|
||||
/// Structured key/value fields attached to this entry — a frozen
|
||||
/// snapshot of the thread-local FieldScope stack at log time.
|
||||
/// Formatters expose them as custom pattern tokens
|
||||
/// (`{field:key}`) and in JSON/logfmt output. Later duplicate
|
||||
/// keys win.
|
||||
/// Structured key/value fields attached to this entry.
|
||||
std::vector<std::pair<std::string, std::string>> fields{};
|
||||
|
||||
/// True when explicit oversize-truncation policy clipped message,
|
||||
/// fields, scopes, or formatted payload.
|
||||
bool truncated{false};
|
||||
};
|
||||
|
||||
} // namespace Void::Logging
|
||||
} // namespace Void::Logging
|
||||
Reference in new issue
Block a user