📝 align portable examples and release messaging

This commit is contained in:
Nanaloveyuki
2026-05-21 14:12:56 +08:00
parent d4f83f5ccb
commit 3e8d4c50a9
9 changed files with 135 additions and 74 deletions
+20 -12
View File
@@ -10,12 +10,18 @@ BitLogger is designed to provide composable, configurable, and cross-target logg
## Backend Compatibility
| Module / capability | native / llvm | js / wasm / wasm-gc |
Currently verified targets: `native`, `js`, `wasm`, and `wasm-gc`.
`llvm` should still be treated as experimental here: verification did not complete in the current environment, and local reproduction depends on nightly / llvm toolchain conditions, so it is not presented as a stable promise at the same level as `native`.
| Module / capability | Verified targets | `llvm` |
| --- | --- | --- |
| `src` core package | Supported | Supported |
| `file_sink(...)` | Supported | Not available, `native_files_supported()` returns `false` |
| `src-async` | Native worker semantics | Compatibility implementation |
| `examples/async_basic` | Supported | Not shipped currently because `async fn main` entry support is still limited |
| `src` core package | Verified on `native`, `js`, `wasm`, and `wasm-gc` | Experimental; not fully verified in the current environment |
| `file(...)` / `file_sink(...)` | Verified only on `native`; unavailable on non-native targets and `native_files_supported()` returns `false` | Not presented as a verified capability |
| `src-async` | Local verification passed on `native` and `wasm`; other non-native targets still follow the compatibility-implementation wording | Experimental; not fully verified in the current environment |
| portable examples (`console_basic` / `text_formatter` / `style_tags` / `config_build` / `presets`) | Verified on `native` and `wasm-gc` | Not yet verified here |
| `examples/file_rotation` | Verified on `native`; non-native targets print a clear skip message because file sinks are unavailable | Not yet verified here |
| `examples/async_basic` | Verified on `native`; non-native example shipping is still limited by the current `async fn main` entry path | Not yet verified here |
## Key Features
@@ -49,6 +55,8 @@ Start new synchronous code with `presets + build_logger(...)`: use `console(...)
Switch to `Logger::new(...)` when you need direct runtime sink composition such as `fanout`, `split`, `callback`, or custom patch/filter graphs.
For cross-target code, prefer the console, json console, text console, and config-parser paths first. File sinks and file presets remain native-sensitive and should be gated with `native_files_supported()`.
Async entry example:
```moonbit
@@ -66,13 +74,13 @@ let logger = async_logger(console_sink(), target="async.demo")
- `src-async/`: async logging layer built on `moonbitlang/async`.
- `docs/api/`: one-file-per-interface API documentation.
- `examples/basic/`: breadth example; starts with the recommended presets-based sync path and then sweeps broader capabilities.
- `examples/console_basic/`: minimal console and JSON console output.
- `examples/text_formatter/`: text formatter and template example.
- `examples/style_tags/`: style tag and colored formatter example.
- `examples/file_rotation/`: file sink and rotation example.
- `examples/config_build/`: config-driven `build_logger(...)` example.
- `examples/presets/`: presets-based construction example.
- `examples/async_basic/`: async logger example.
- `examples/console_basic/`: portable minimal console and JSON console output.
- `examples/text_formatter/`: portable text formatter and template example.
- `examples/style_tags/`: portable style tag and colored formatter example.
- `examples/file_rotation/`: target-sensitive file sink and rotation example with an explicit non-native skip path.
- `examples/config_build/`: portable config-driven `build_logger(...)` example.
- `examples/presets/`: portable-first presets example; adds file preset usage only when native file support is available.
- `examples/async_basic/`: native-only async logger example; the limitation is the `async fn main` entry path, not the absence of `src-async` compatibility APIs.
## Documentation Entry Points