Restructure into umbrella modules (~55 -> 16 targets)
Headers move, CMake targets merge, C++ namespaces stay unchanged: - Core: Scope, Lazy, Counted, Flags, Hash, Bits, Uuid, TypeList, TypeMap, Variant - Functional: Pipeline, Either, Result, Retry - Containers: Ring, Pool, PriorityQueue, LRU, Trie, Graph, DisjointSet, Bitset, Interval - Math: +Matrix, Numeric, Random, Histogram - Text: Str, Format, Tokenizer, Diff, Encoding, Semver - Data: Json, Csv, Ini - Async: Coro, Concurrency, EventBus, Observable - Time: +Bench - Log: Log facade + Logging framework (facade now header-only, breaking the Stacktrace<->Log link cycle the merge would have created) - System: FileSystem + Process - Configuration: +Argparse - Unchanged: Stacktrace, Plugin, StateMachine, Testing, TestingMock, Detail Module system fixes: - OPTIONAL_DEPS resolution deferred to void_finalize_modules() so it no longer depends on the alphabetical discovery order of src/ subdirs (Testing -> Text would have been silently dropped). - Every header-only module now has a tracked module.cmake; previously the empty src/<Name> marker dirs were untracked, so a fresh clone would have silently skipped those modules. - VOID_HAS_LOGGING/CONCURRENCY/STR consumers renamed to LOG/ASYNC/TEXT. Tests move to tests/standalone/<Umbrella>/<Feature>.cpp (Result suite files prefixed: ResultBasic etc.). Test count verified identical (831) before and after. README/CLAUDE.md module tables updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
da2e93c405
commit
28b94883fd
156 files changed
+278
-220
No files matched your search
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include <Void/Log/Level.hpp>
|
||||
|
||||
#include <chrono>
|
||||
#include <source_location>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
/// 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. 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.
|
||||
std::vector<std::string> scopes{};
|
||||
};
|
||||
|
||||
} // namespace Void::Logging
|
||||
Reference in new issue
Block a user