📝 clarify async error helper routing

This commit is contained in:
Nanaloveyuki
2026-06-14 11:19:08 +08:00
parent b0364fdd51
commit 3a216a2ada
+5 -1
View File
@@ -40,7 +40,7 @@ pub async fn[S] AsyncLogger::error(
Detailed rules explaining key parameters and behaviors
- This helper delegates to `log(Level::Error, ..., fields=fields)`.
- The record is still subject to patching, filtering, and overflow policy.
- The record is still subject to min-level gating, patching, filtering, and overflow policy.
- 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(...)`.
- Error records represent the highest built-in severity in this logger API.
- Use this helper when a named error call is clearer than a raw `log(...)` call.
@@ -70,6 +70,10 @@ logger.error(
In this example, the error record carries structured context without falling back to the generic `log(...)` form.
And any shared context already carried by the logger still participates ahead of these per-call fields when the record is built.
The write still uses the logger's stored target because this shortcut does not take a one-off `target=` override.
### Error Case
e.g.: