mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-24 00:42:18 +00:00
📝 align remaining async examples
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
name: async-logger-debug
|
||||
group: api
|
||||
category: async
|
||||
update-time: 20260512
|
||||
description: Enqueue a debug-level record through the async logger using the built-in severity shortcut.
|
||||
update-time: 20260614
|
||||
description: Enqueue a debug-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 intermediate async flow details should be visible during debugging:
|
||||
```moonbit
|
||||
await logger.debug("loaded worker config")
|
||||
logger.debug("loaded worker config")
|
||||
```
|
||||
|
||||
In this example, the call site communicates its intended diagnostic level directly.
|
||||
@@ -61,7 +61,7 @@ In this example, the call site communicates its intended diagnostic level direct
|
||||
|
||||
When a debug event should include extra fields:
|
||||
```moonbit
|
||||
await logger.debug(
|
||||
logger.debug(
|
||||
"dispatch start",
|
||||
fields=[@bitlogger.field("job_id", "42")],
|
||||
)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
name: async-logger-trace
|
||||
group: api
|
||||
category: async
|
||||
update-time: 20260512
|
||||
description: Enqueue a trace-level record through the async logger using the lowest built-in severity shortcut.
|
||||
update-time: 20260614
|
||||
description: Enqueue a trace-level record through the async logger using the lowest 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 low-level execution flow should be observable during debugging:
|
||||
```moonbit
|
||||
await logger.trace("entered reconciliation step")
|
||||
logger.trace("entered reconciliation step")
|
||||
```
|
||||
|
||||
In this example, the call site makes trace intent explicit.
|
||||
@@ -61,7 +61,7 @@ In this example, the call site makes trace intent explicit.
|
||||
|
||||
When a trace event should carry extra fields:
|
||||
```moonbit
|
||||
await logger.trace(
|
||||
logger.trace(
|
||||
"cache probe",
|
||||
fields=[@bitlogger.field("key", "user:42")],
|
||||
)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
name: library-async-logger-is-enabled
|
||||
group: api
|
||||
category: facade
|
||||
update-time: 20260613
|
||||
description: Check whether a LibraryAsyncLogger facade would accept a record at a given level.
|
||||
update-time: 20260614
|
||||
description: Check whether a LibraryAsyncLogger facade would accept a record at a given level before using the repo's direct async call style.
|
||||
key-word:
|
||||
- async
|
||||
- library
|
||||
@@ -51,7 +51,7 @@ Here are some specific examples provided.
|
||||
When debug data should only be built if needed:
|
||||
```moonbit
|
||||
if logger.is_enabled(@bitlogger.Level::Info) {
|
||||
await logger.info(build_summary())
|
||||
logger.info(build_summary())
|
||||
}
|
||||
```
|
||||
|
||||
@@ -62,7 +62,7 @@ In this example, expensive preparation is skipped unless the current threshold a
|
||||
When package code should branch based on current logger behavior:
|
||||
```moonbit
|
||||
if logger.is_enabled(@bitlogger.Level::Warn) {
|
||||
await logger.warn("slow path active")
|
||||
logger.warn("slow path active")
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user