diff --git a/README.md b/README.md index 32bea3a..d7728e9 100644 --- a/README.md +++ b/README.md @@ -189,3 +189,10 @@ if native_files_supported() { - 当前 async API 已支持 `with_context_fields(...)`、`with_filter(...)`、`with_patch(...)`、`with_target(...)`、`child(...)` - 推荐启动方式见 [examples/async_basic/main.mbt](/E:/repo/MooLiteyukiBot/examples/async_basic/main.mbt:1) - 这层目前仅面向 `native/llvm` backend;它是独立 adapter,不会污染现有同步 core + +### Async Config + +- 当前已支持 `parse_async_logger_build_config_text(...)` 与 `build_async_logger(...)` +- JSON 顶层结构分为两个字段:`logger` 与 `async_config` +- `logger` 完全复用同步 `LoggerConfig` 的 schema;`async_config` 当前支持 `max_pending` 与 `overflow` +- 当前推荐写法可直接参考 [examples/async_basic/main.mbt](/E:/repo/MooLiteyukiBot/examples/async_basic/main.mbt:1) diff --git a/docs/README-en.md b/docs/README-en.md index 79cb1aa..933b3ae 100644 --- a/docs/README-en.md +++ b/docs/README-en.md @@ -178,3 +178,10 @@ if native_files_supported() { - The current async API already supports `with_context_fields(...)`, `with_filter(...)`, `with_patch(...)`, `with_target(...)`, and `child(...)`. - The recommended startup pattern is shown in [examples/async_basic/main.mbt](/E:/repo/MooLiteyukiBot/examples/async_basic/main.mbt:1). - This layer currently targets `native/llvm` only and remains isolated from the synchronous logger core. + +### Async Config + +- `parse_async_logger_build_config_text(...)` and `build_async_logger(...)` are now available. +- The JSON root is split into `logger` and `async_config`. +- `logger` fully reuses the synchronous `LoggerConfig` schema, while `async_config` currently supports `max_pending` and `overflow`. +- The recommended config-driven startup flow is shown in [examples/async_basic/main.mbt](/E:/repo/MooLiteyukiBot/examples/async_basic/main.mbt:1). diff --git a/docs/changes/0.3.0.md b/docs/changes/0.3.0.md index d3ff573..614aaf9 100644 --- a/docs/changes/0.3.0.md +++ b/docs/changes/0.3.0.md @@ -16,6 +16,7 @@ version 0.3.0 - feat: add `bitlogger_async/` as a separate native-target async adapter package - feat: add `AsyncLogger`, `async_logger(...)`, `run()`, `wait_idle()`, `close()`, `pending_count()`, and `dropped_count()` on top of `moonbitlang/async` - feat: add async logger composition helpers `with_context_fields(...)`, `with_filter(...)`, `with_patch(...)`, `with_target(...)`, `child(...)`, and `with_timestamp(...)` +- feat: add `AsyncLoggerBuildConfig`, `parse_async_logger_build_config_text(...)`, and `build_async_logger(...)` for config-driven async logger assembly - feat: expose `Record::new(...)` for adapter and integration layers - fix: repair native file backend FFI declarations so native target checks succeed again - feat: support config keys `min_level`, `target`, `timestamp`, `sink.kind`, `sink.path`, `sink.append`, `sink.auto_flush`, `sink.text_formatter`, and `queue` @@ -37,6 +38,7 @@ version 0.3.0 - docs: update `examples/basic` with JSON config loading example - docs: update `examples/basic` to use `parse_and_build_logger(...)` with explicit error handling in `main` - docs: add `examples/async_basic` to show async worker startup and queue-backed logging flow +- docs: update `examples/async_basic` to use unified JSON-driven async logger config - docs: update root README, English README, and Mooncake README with config usage notes - docs: update root README and English README with async adapter notes and current scope - chore: ignore local `.mooncakes/` cache directory in git