From 302e11218c9c60d5bdf5726409e785c16249196b Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Sun, 14 Jun 2026 06:57:12 +0800 Subject: [PATCH] :memo: sharpen closed async log docs --- docs/api/async-logger-is-closed.md | 2 +- docs/api/library-async-logger-log.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/async-logger-is-closed.md b/docs/api/async-logger-is-closed.md index 6cda9a9..0b2fefd 100644 --- a/docs/api/async-logger-is-closed.md +++ b/docs/api/async-logger-is-closed.md @@ -38,7 +38,7 @@ Detailed rules explaining key parameters and behaviors - A closed logger should no longer be treated as a normal active enqueue target. - This helper is only a direct read of the current `is_closed` ref; it does not wait for drain completion or clear any other state. - This helper reflects lifecycle state only and does not indicate whether the worker is still draining. -- Exact post-close logging behavior is runtime-dependent, so `is_closed()` should be read as a lifecycle signal rather than a full enqueue-policy contract. +- Exact post-close logging behavior is runtime-dependent: compatibility runtimes can short-circuit before patch and enqueue work, while native-worker runtimes may still build and patch a record before the closed queue rejects it, so `is_closed()` should be read as a lifecycle signal rather than a full enqueue-policy contract. ### How to Use diff --git a/docs/api/library-async-logger-log.md b/docs/api/library-async-logger-log.md index 3ed71d8..09339c7 100644 --- a/docs/api/library-async-logger-log.md +++ b/docs/api/library-async-logger-log.md @@ -47,7 +47,7 @@ Detailed rules explaining key parameters and behaviors - The logger checks `is_enabled(level)` before building a record. - Stored shared context fields are prepended ahead of per-call `fields`, then patch and filter logic are applied before enqueue. - If `target` is empty, the logger uses its current default target; otherwise the provided per-call target overrides that default for this one write. -- The narrower library facade does not change enqueue semantics, overflow handling, or runtime-dependent closed-on-log behavior; it only limits the visible API surface. +- The narrower library facade does not change enqueue semantics, overflow handling, or runtime-dependent closed-on-log behavior; in particular, compatibility runtimes can short-circuit before patch and enqueue work, while native-worker runtimes may still reach wrapped record construction and then treat the closed queue as a non-accepted write. The facade only limits the visible API surface. - Async state helpers such as `pending_count()`, `dropped_count()`, `state()`, `has_failed()`, and `last_error()` remain on the underlying `AsyncLogger[S]` and require `to_async_logger()` first. ### How to Use