From e035625fc106b91ff8f9814565f015e3e421f2fd Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Sun, 14 Jun 2026 00:12:51 +0800 Subject: [PATCH] :memo: align async write examples --- docs/api/async-logger-error.md | 8 ++++---- docs/api/async-logger-info.md | 8 ++++---- docs/api/async-logger-log.md | 8 ++++---- docs/api/async-logger-warn.md | 8 ++++---- docs/api/library-async-logger-error.md | 8 ++++---- docs/api/library-async-logger-info.md | 8 ++++---- docs/api/library-async-logger-log.md | 8 ++++---- docs/api/library-async-logger-warn.md | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/api/async-logger-error.md b/docs/api/async-logger-error.md index 1ffc4b8..a649313 100644 --- a/docs/api/async-logger-error.md +++ b/docs/api/async-logger-error.md @@ -2,8 +2,8 @@ name: async-logger-error group: api category: async -update-time: 20260512 -description: Enqueue an error-level record through the async logger using the highest built-in severity shortcut. +update-time: 20260614 +description: Enqueue an error-level record through the async logger using the highest built-in severity shortcut and the repo's direct async call style. key-word: - async - logger @@ -52,7 +52,7 @@ Here are some specific examples provided. When an operation should emit a high-severity failure event: ```moonbit -await logger.error("worker execution failed") +logger.error("worker execution failed") ``` In this example, failure intent is explicit at the call site. @@ -61,7 +61,7 @@ In this example, failure intent is explicit at the call site. When an error event should include diagnostic fields: ```moonbit -await logger.error( +logger.error( "dispatch failed", fields=[@bitlogger.field("job_id", "42")], ) diff --git a/docs/api/async-logger-info.md b/docs/api/async-logger-info.md index a7d5b38..ea66033 100644 --- a/docs/api/async-logger-info.md +++ b/docs/api/async-logger-info.md @@ -2,8 +2,8 @@ name: async-logger-info group: api category: async -update-time: 20260512 -description: Enqueue an info-level record through the async logger using the most common built-in severity shortcut. +update-time: 20260614 +description: Enqueue an info-level record through the async logger using the most common built-in severity shortcut and the repo's direct async call style. key-word: - async - logger @@ -52,7 +52,7 @@ Here are some specific examples provided. When async code should report routine progress or lifecycle events: ```moonbit -await logger.info("worker started") +logger.info("worker started") ``` In this example, the event is expressed at the most common operational logging level. @@ -61,7 +61,7 @@ In this example, the event is expressed at the most common operational logging l When an info event should include stable structured detail: ```moonbit -await logger.info( +logger.info( "job queued", fields=[@bitlogger.field("queue", "sync")], ) diff --git a/docs/api/async-logger-log.md b/docs/api/async-logger-log.md index a7af6fd..7497a07 100644 --- a/docs/api/async-logger-log.md +++ b/docs/api/async-logger-log.md @@ -2,8 +2,8 @@ name: async-logger-log group: api category: async -update-time: 20260512 -description: Enqueue a record into the async logger with an explicit level, message, optional fields, and optional target override. +update-time: 20260614 +description: Enqueue a record into the async logger with an explicit level, message, optional fields, and optional target override, using the repo's direct async call style. key-word: - async - logger @@ -56,7 +56,7 @@ Here are some specific examples provided. When code should choose level, fields, and target per event: ```moonbit -await logger.log( +logger.log( @bitlogger.Level::Info, "worker started", fields=[@bitlogger.field("job", "sync")], @@ -70,7 +70,7 @@ In this example, all per-record inputs are supplied explicitly. When application code wants a custom wrapper around the base API: ```moonbit -await logger.log(@bitlogger.Level::Warn, "slow request") +logger.log(@bitlogger.Level::Warn, "slow request") ``` In this example, `log(...)` acts as the common primitive under custom wrappers or convenience methods. diff --git a/docs/api/async-logger-warn.md b/docs/api/async-logger-warn.md index b6de9a0..adc8f4d 100644 --- a/docs/api/async-logger-warn.md +++ b/docs/api/async-logger-warn.md @@ -2,8 +2,8 @@ name: async-logger-warn group: api category: async -update-time: 20260512 -description: Enqueue a warning-level record through the async logger using the built-in severity shortcut. +update-time: 20260614 +description: Enqueue a warning-level record through the async logger using the built-in severity shortcut and the repo's direct async call style. key-word: - async - logger @@ -52,7 +52,7 @@ Here are some specific examples provided. When the system should report a non-fatal problem: ```moonbit -await logger.warn("retry budget running low") +logger.warn("retry budget running low") ``` In this example, the event is surfaced at warning severity without using the generic `log(...)` form. @@ -61,7 +61,7 @@ In this example, the event is surfaced at warning severity without using the gen When a warning event should include context: ```moonbit -await logger.warn( +logger.warn( "queue near capacity", fields=[@bitlogger.field("pending", logger.pending_count().to_string())], ) diff --git a/docs/api/library-async-logger-error.md b/docs/api/library-async-logger-error.md index 1c513f0..89ea0bb 100644 --- a/docs/api/library-async-logger-error.md +++ b/docs/api/library-async-logger-error.md @@ -2,8 +2,8 @@ name: library-async-logger-error group: api category: facade -update-time: 20260613 -description: Enqueue an error-level record through a LibraryAsyncLogger facade using the highest built-in severity shortcut. +update-time: 20260614 +description: Enqueue an error-level record through a LibraryAsyncLogger facade using the highest built-in severity shortcut and the repo's direct async call style. key-word: - async - library @@ -52,7 +52,7 @@ Here are some specific examples provided. When an operation should emit a high-severity failure event: ```moonbit -await logger.error("worker execution failed") +logger.error("worker execution failed") ``` In this example, failure intent is explicit at the call site. @@ -61,7 +61,7 @@ In this example, failure intent is explicit at the call site. When an error event should include diagnostic fields: ```moonbit -await logger.error( +logger.error( "dispatch failed", fields=[@bitlogger.field("job_id", "42")], ) diff --git a/docs/api/library-async-logger-info.md b/docs/api/library-async-logger-info.md index fb4ad7b..ff047c0 100644 --- a/docs/api/library-async-logger-info.md +++ b/docs/api/library-async-logger-info.md @@ -2,8 +2,8 @@ name: library-async-logger-info group: api category: facade -update-time: 20260613 -description: Enqueue an info-level record through a LibraryAsyncLogger facade using the informational severity shortcut. +update-time: 20260614 +description: Enqueue an info-level record through a LibraryAsyncLogger facade using the informational severity shortcut and the repo's direct async call style. key-word: - async - library @@ -52,7 +52,7 @@ Here are some specific examples provided. When async package code should report routine progress or lifecycle events: ```moonbit -await logger.info("worker started") +logger.info("worker started") ``` In this example, the event is expressed at the common operational logging level through the narrower facade. @@ -61,7 +61,7 @@ In this example, the event is expressed at the common operational logging level When an info event should include stable structured detail: ```moonbit -await logger.info( +logger.info( "job queued", fields=[@bitlogger.field("queue", "sync")], ) diff --git a/docs/api/library-async-logger-log.md b/docs/api/library-async-logger-log.md index 163ba8e..20dfbc2 100644 --- a/docs/api/library-async-logger-log.md +++ b/docs/api/library-async-logger-log.md @@ -2,8 +2,8 @@ name: library-async-logger-log group: api category: facade -update-time: 20260613 -description: Enqueue a record through a LibraryAsyncLogger facade with explicit level, message, fields, and optional target override. +update-time: 20260614 +description: Enqueue a record through a LibraryAsyncLogger facade with explicit level, message, fields, and optional target override, using the repo's direct async call style. key-word: - async - library @@ -56,7 +56,7 @@ Here are some specific examples provided. When library code should choose level, fields, and target per event: ```moonbit -await logger.log( +logger.log( @bitlogger.Level::Info, "worker started", fields=[@bitlogger.field("job", "sync")], @@ -70,7 +70,7 @@ In this example, the call site controls every major record property while keepin When package code defines its own logging helpers: ```moonbit -await logger.log(@bitlogger.Level::Warn, "slow request") +logger.log(@bitlogger.Level::Warn, "slow request") ``` In this example, `log(...)` acts as the shared primitive under custom library-facing wrappers. diff --git a/docs/api/library-async-logger-warn.md b/docs/api/library-async-logger-warn.md index dcb6182..a17a523 100644 --- a/docs/api/library-async-logger-warn.md +++ b/docs/api/library-async-logger-warn.md @@ -2,8 +2,8 @@ name: library-async-logger-warn group: api category: facade -update-time: 20260613 -description: Enqueue a warning-level record through a LibraryAsyncLogger facade using the built-in severity shortcut. +update-time: 20260614 +description: Enqueue a warning-level record through a LibraryAsyncLogger facade using the built-in severity shortcut and the repo's direct async call style. key-word: - async - library @@ -52,7 +52,7 @@ Here are some specific examples provided. When the system should report a non-fatal problem: ```moonbit -await logger.warn("retry budget running low") +logger.warn("retry budget running low") ``` In this example, the event is surfaced at warning severity without using the generic `log(...)` form. @@ -61,7 +61,7 @@ In this example, the event is surfaced at warning severity without using the gen When a warning event should include context: ```moonbit -await logger.warn( +logger.warn( "queue near capacity", fields=[@bitlogger.field("pending", "64")], )