From 1e487f2ffcc84bb03ddafbc0d51c00cc4cc14f71 Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Tue, 12 May 2026 14:30:49 +0800 Subject: [PATCH] :memo: Add API index and simplify README links --- README.md | 14 +---- docs/api/index.md | 127 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 docs/api/index.md diff --git a/README.md b/README.md index d2201cc..00f039c 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ BitLogger 是一个使用 MoonBit 编写的结构化日志库,目标是提供可组合、可配置、可跨端编译的日志基础设施。 -README 仅保留项目定位、关键特性和最小使用入口。详细 API 请查看 `docs/api/`。 - ## 🧭 后端兼容 | 模块 / 能力 | native / llvm | js / wasm / wasm-gc | @@ -68,17 +66,7 @@ let logger = async_logger(console_sink(), target="async.demo") - [Mooncake 文档页](https://mooncakes.io/docs/Nanaloveyuki/BitLogger) - [English README](./docs/README-en.md) - [bitlogger package README](./bitlogger/README.mbt.md) -- `docs/api/` 中的单接口文档,例如: -- [logger-new.md](./docs/api/logger-new.md) -- [async-logger.md](./docs/api/async-logger.md) -- [build-logger.md](./docs/api/build-logger.md) -- [build-async-logger.md](./docs/api/build-async-logger.md) - -## 📝 说明 - -- `README.md` 不再承担 API 手册职责,详细接口、配置字段和运行时控制面已回收到 `docs/api/`。 -- 如果你在找具体方法如 `with_filter(...)`、`file_reopen(...)`、`AsyncLogger::shutdown(...)`、`ConfiguredLogger::file_runtime_state()`,请直接查看 `docs/api/`。 -- 如果你在找完整可运行用法,优先看 `examples/`。 +- [API 索引](./docs/api/index.md) ## 🧵 异步层概览 diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000..620997e --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,127 @@ +--- +name: api-index +group: api +category: index +update-time: 20260512 +description: API navigation index for BitLogger and bitlogger_async. +key-word: + - api + - index + - logger + - async +--- + +## Api-index + +BitLogger API navigation. + +## Core logger + +- [logger-new.md](./logger-new.md) +- [logger-with-target.md](./logger-with-target.md) +- [logger-child.md](./logger-child.md) +- [logger-with-min-level.md](./logger-with-min-level.md) +- [logger-with-timestamp.md](./logger-with-timestamp.md) +- [logger-with-context-fields.md](./logger-with-context-fields.md) +- [logger-with-filter.md](./logger-with-filter.md) +- [logger-with-patch.md](./logger-with-patch.md) +- [logger-with-queue.md](./logger-with-queue.md) + +## Formatter and fields + +- [text-formatter.md](./text-formatter.md) +- [text-formatter-config.md](./text-formatter-config.md) +- [text-formatter-config-to-json.md](./text-formatter-config-to-json.md) +- [stringify-text-formatter-config.md](./stringify-text-formatter-config.md) +- [fields.md](./fields.md) + +## Sink and file + +- [file-sink.md](./file-sink.md) +- [file-rotation.md](./file-rotation.md) +- [sink-config.md](./sink-config.md) +- [sink-config-to-json.md](./sink-config-to-json.md) +- [stringify-sink-config.md](./stringify-sink-config.md) + +## Predicates and helpers + +- [target-has-prefix.md](./target-has-prefix.md) + +## Config build flow + +- [queue-config.md](./queue-config.md) +- [queue-config-to-json.md](./queue-config-to-json.md) +- [stringify-queue-config.md](./stringify-queue-config.md) +- [logger-config.md](./logger-config.md) +- [logger-config-to-json.md](./logger-config-to-json.md) +- [stringify-logger-config.md](./stringify-logger-config.md) +- [parse-logger-config-text.md](./parse-logger-config-text.md) +- [build-logger.md](./build-logger.md) +- [parse-and-build-logger.md](./parse-and-build-logger.md) + +## Async logger + +- [async-logger.md](./async-logger.md) +- [async-logger-run.md](./async-logger-run.md) +- [async-logger-log.md](./async-logger-log.md) +- [async-logger-trace.md](./async-logger-trace.md) +- [async-logger-debug.md](./async-logger-debug.md) +- [async-logger-info.md](./async-logger-info.md) +- [async-logger-warn.md](./async-logger-warn.md) +- [async-logger-error.md](./async-logger-error.md) + +## Async composition + +- [async-logger-with-target.md](./async-logger-with-target.md) +- [async-logger-child.md](./async-logger-child.md) +- [async-logger-with-min-level.md](./async-logger-with-min-level.md) +- [async-logger-with-timestamp.md](./async-logger-with-timestamp.md) +- [async-logger-with-context-fields.md](./async-logger-with-context-fields.md) +- [async-logger-with-filter.md](./async-logger-with-filter.md) +- [async-logger-with-patch.md](./async-logger-with-patch.md) + +## Async lifecycle and state + +- [async-logger-pending-count.md](./async-logger-pending-count.md) +- [async-logger-dropped-count.md](./async-logger-dropped-count.md) +- [async-logger-is-closed.md](./async-logger-is-closed.md) +- [async-logger-is-running.md](./async-logger-is-running.md) +- [async-logger-has-failed.md](./async-logger-has-failed.md) +- [async-logger-last-error.md](./async-logger-last-error.md) +- [async-logger-flush-policy.md](./async-logger-flush-policy.md) +- [async-logger-state.md](./async-logger-state.md) +- [async-logger-state-to-json.md](./async-logger-state-to-json.md) +- [stringify-async-logger-state.md](./stringify-async-logger-state.md) +- [async-logger-close.md](./async-logger-close.md) +- [async-logger-wait-idle.md](./async-logger-wait-idle.md) +- [async-logger-shutdown.md](./async-logger-shutdown.md) + +## Async runtime and config + +- [async-runtime-mode.md](./async-runtime-mode.md) +- [async-runtime-mode-label.md](./async-runtime-mode-label.md) +- [async-runtime-supports-background-worker.md](./async-runtime-supports-background-worker.md) +- [async-runtime-state.md](./async-runtime-state.md) +- [async-runtime-state-to-json.md](./async-runtime-state-to-json.md) +- [stringify-async-runtime-state.md](./stringify-async-runtime-state.md) +- [async-logger-config.md](./async-logger-config.md) +- [async-logger-config-to-json.md](./async-logger-config-to-json.md) +- [stringify-async-logger-config.md](./stringify-async-logger-config.md) +- [parse-async-logger-build-config-text.md](./parse-async-logger-build-config-text.md) +- [build-async-logger.md](./build-async-logger.md) +- [async-logger-build-config-to-json.md](./async-logger-build-config-to-json.md) +- [stringify-async-logger-build-config.md](./stringify-async-logger-build-config.md) + +## Configured logger runtime + +- [configured-logger-flush.md](./configured-logger-flush.md) +- [configured-logger-drain.md](./configured-logger-drain.md) +- [configured-logger-close.md](./configured-logger-close.md) +- [configured-logger-pending-count.md](./configured-logger-pending-count.md) +- [configured-logger-dropped-count.md](./configured-logger-dropped-count.md) +- [configured-logger-file-available.md](./configured-logger-file-available.md) +- [configured-logger-file-path.md](./configured-logger-file-path.md) +- [configured-logger-file-flush.md](./configured-logger-file-flush.md) +- [configured-logger-file-close.md](./configured-logger-file-close.md) +- [configured-logger-file-reopen.md](./configured-logger-file-reopen.md) +- [configured-logger-file-runtime-state.md](./configured-logger-file-runtime-state.md)