diff options
| author | Stefan Boberg <[email protected]> | 2026-04-22 12:35:46 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-22 12:35:46 +0200 |
| commit | 8b42ed4b6e995ac0336d1abe6425cfadf239f8d2 (patch) | |
| tree | cf447d4802c9bbdc782c6799705eb8bbe64c5f6c /src/zencore/trace.cpp | |
| parent | dashboard prominent version (#1009) (diff) | |
| download | archived-zen-8b42ed4b6e995ac0336d1abe6425cfadf239f8d2.tar.xz archived-zen-8b42ed4b6e995ac0336d1abe6425cfadf239f8d2.zip | |
Zen-style trace log events (#1006)
Replaces the old (not fully implemented) UE `Logging.*` sink with a typed `ZenLog.*` trace path that preserves structured fmt args end-to-end, so the zen trace analyzer (and future consumers) can re-render log messages with full formatter support.
- Hook `Logger::Log` to tap `fmt::format_args` before `vformat` renders them, and emit three new events on a dedicated `ZenLogChannel`: `Category`, `MessageSpec`, `Message`. Args are serialized as `[count][descriptors][payload]` with distinct categories for bool, int, float, and string. Custom formatters fall back to a pre-rendered string.
- Bool has its own wire category so `{}` renders as `true`/`false` and `{:d}` as `1`/`0`.
- Zen `LogLevel` is translated to UE `ELogVerbosity` on emit so severity filtering works consistently.
- Extend the zen trace analyzer to decode `ZenLog.*` via `fmt::vformat` + `dynamic_format_arg_store` — nested widths, chrono specs, etc. all work. Strings are passed as views directly from the event payload (which outlives the format call) rather than copied through a pool.
- Retire the old `TraceSink` stub; the typed path supersedes it.
- Switch `--trace=default` alias from `cpu,log` to `cpu,zenlog`.
- Add `__int128` overloads to the arg encoder guarded by `FMT_USE_INT128` so fmt's int128 dispatch resolves unambiguously on clang/gcc. MSVC and clang-cl are unaffected.
Diffstat (limited to 'src/zencore/trace.cpp')
| -rw-r--r-- | src/zencore/trace.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zencore/trace.cpp b/src/zencore/trace.cpp index 6e2eea1c7..2dec0511c 100644 --- a/src/zencore/trace.cpp +++ b/src/zencore/trace.cpp @@ -55,7 +55,7 @@ TraceConfigure(const TraceOptions& Options) auto ProcessTraceArg = [&](const std::string_view& Arg) { if (Arg == "default"sv) { - ProcessChannelList("cpu,log"sv); + ProcessChannelList("cpu,zenlog"sv); } else if (Arg == "memory"sv) { @@ -70,6 +70,12 @@ TraceConfigure(const TraceOptions& Options) // memtag actually traces to the memalloc channel ProcessChannelList("memalloc"sv); } + else if (Arg == "log"sv) + { + // Upstream UE trace reserves "log" for printf-style Logging.* events, which zen + // does not emit. Redirect to the zenlog channel so --trace=log does what users expect. + ProcessChannelList("zenlog"sv); + } else { // Presume that the argument is a trace channel name |