From 5720ba6203b0232dcb5585e9aa49ad87d2424613 Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Sun, 14 Jun 2026 11:23:34 +0800 Subject: [PATCH] :memo: clarify logger trace helper routing --- docs/api/logger-trace.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api/logger-trace.md b/docs/api/logger-trace.md index 7ed611c..fa16e44 100644 --- a/docs/api/logger-trace.md +++ b/docs/api/logger-trace.md @@ -37,7 +37,7 @@ Detailed rules explaining key parameters and behaviors - This helper delegates to `log(Level::Trace, ...)`. - Trace is the lowest built-in severity and is often disabled in production. -- Per-call target override is not exposed here; use `log(...)` if that is needed. +- This helper does not accept a per-call target override. It uses the logger's stored target unless the logger was derived earlier with `with_target(...)` or `child(...)`. - Context, filtering, patching, and queue wrappers still apply through the logger sink chain. ### How to Use @@ -62,6 +62,10 @@ logger.trace("cache probe", fields=[field("key", "user:42")]) In this example, trace output stays lightweight while still carrying structured detail. +And any shared context already carried by the logger still participates through the sink pipeline. + +The write still uses the logger's stored target because this shortcut does not take a one-off `target=` override. + ### Error Case e.g.: