From a745cd517228d6ffe30eafe043a929b3de126b7c Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Fri, 17 Jul 2026 18:06:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20add=20Chinese=20API=20guides=20a?= =?UTF-8?q?nd=20locale=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vitepress/config.mts | 15 ++++++++- docs/.vitepress/theme/index.ts | 37 ++++++++++++++++++++- docs/zh/api/async.md | 50 ++++++++++++++++++++++++++++ docs/zh/api/basics.md | 55 +++++++++++++++++++++++++++++++ docs/zh/api/composition.md | 52 +++++++++++++++++++++++++++++ docs/zh/api/configuration.md | 53 +++++++++++++++++++++++++++++ docs/zh/api/file-output.md | 49 +++++++++++++++++++++++++++ docs/zh/api/formatting.md | 40 ++++++++++++++++++++++ docs/zh/api/index.md | 14 ++++++++ docs/zh/examples/async.md | 2 +- docs/zh/examples/config.md | 2 +- docs/zh/examples/console.md | 2 +- docs/zh/examples/file-rotation.md | 2 +- docs/zh/extend/composition.md | 7 ++-- docs/zh/extend/formatting.md | 7 ++-- docs/zh/extend/queue.md | 7 ++-- docs/zh/extend/targets.md | 6 ++-- docs/zh/index.md | 2 +- 18 files changed, 376 insertions(+), 26 deletions(-) create mode 100644 docs/zh/api/async.md create mode 100644 docs/zh/api/basics.md create mode 100644 docs/zh/api/composition.md create mode 100644 docs/zh/api/configuration.md create mode 100644 docs/zh/api/file-output.md create mode 100644 docs/zh/api/formatting.md create mode 100644 docs/zh/api/index.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 1d7555a..6a0b166 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -144,6 +144,18 @@ function buildChineseExtendSidebar(): DefaultTheme.SidebarItem[] { ] } +function buildChineseApiSidebar(): DefaultTheme.SidebarItem[] { + return [ + { text: '概览', link: '/zh/api/' }, + { text: '基础记录', link: '/zh/api/basics' }, + { text: '配置与队列', link: '/zh/api/configuration' }, + { text: '文件输出', link: '/zh/api/file-output' }, + { text: '文本格式', link: '/zh/api/formatting' }, + { text: '异步生命周期', link: '/zh/api/async' }, + { text: 'Sink 组合', link: '/zh/api/composition' }, + ] +} + const englishThemeConfig: DefaultTheme.Config = { siteTitle: 'BitLogger', nav: [ @@ -180,7 +192,7 @@ const chineseThemeConfig: DefaultTheme.Config = { { text: '首页', link: '/zh/' }, { text: '示例', link: '/zh/examples/' }, { text: '扩展', link: '/zh/extend/' }, - { text: 'API(英文)', link: '/api/' }, + { text: 'API', link: '/zh/api/' }, { text: '更新记录(英文)', link: '/changes/' }, { text: 'Mooncake', link: 'https://mooncakes.io/docs/Nanaloveyuki/BitLogger' }, ], @@ -195,6 +207,7 @@ const chineseThemeConfig: DefaultTheme.Config = { sidebar: { '/zh/examples/': buildChineseExamplesSidebar(), '/zh/extend/': buildChineseExtendSidebar(), + '/zh/api/': buildChineseApiSidebar(), }, footer: { message: '由仓库中的 VitePress 文档构建。', diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 01edcde..65776c7 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -6,11 +6,46 @@ import HomeDocHub from './components/HomeDocHub.vue' import './custom.css' +const localePreferenceKey = 'bitlogger-docs-locale' + +function routePath(path: string): string { + return path.split(/[?#]/, 1)[0] +} + +function isLocaleRoot(path: string): boolean { + const normalized = routePath(path) + return normalized === '/' || normalized === '/zh/' +} + +function browserPrefersChinese(): boolean { + return navigator.languages.some(language => language.toLowerCase().startsWith('zh')) +} + const theme: Theme = { extends: DefaultTheme, - enhanceApp({ app }) { + enhanceApp({ app, router }) { app.component('ApiOverview', ApiOverview) app.component('HomeDocHub', HomeDocHub) + + if (typeof window === 'undefined') return + + router.onAfterRouteChange = to => { + if (!isLocaleRoot(to)) return + window.localStorage.setItem(localePreferenceKey, routePath(to) === '/zh/' ? 'zh' : 'en') + } + + if (router.route.path !== '/') return + + const savedLocale = window.localStorage.getItem(localePreferenceKey) + const locale = savedLocale === 'zh' || savedLocale === 'en' + ? savedLocale + : browserPrefersChinese() + ? 'zh' + : 'en' + + if (locale === 'zh') { + void router.go('/zh/') + } }, } diff --git a/docs/zh/api/async.md b/docs/zh/api/async.md new file mode 100644 index 0000000..666fc24 --- /dev/null +++ b/docs/zh/api/async.md @@ -0,0 +1,50 @@ +# 异步生命周期 API + +异步 API 从 combined config 构建 Logger,再以单 worker 生命周期处理待写入记录。可执行 `async fn main` 仍应按目标平台边界使用。 + +## 解析与构建 + +```moonbit +pub fn parse_async_logger_build_config_text( + input : String, +) -> AsyncLoggerBuildConfig raise + +pub fn build_async_logger( + config : AsyncLoggerBuildConfig, +) -> AsyncLogger[RuntimeSink] +``` + +解析函数同时验证 `logger` 与 `async_config` 两部分;缺少任一部分时使用对应默认配置。构建函数先复用同步 `build_logger(config.logger)` 路径,再包裹异步层,因此保留同步 sink、文件与可选同步队列的运行时语义。 + +```moonbit +let config = @async_log.parse_async_logger_build_config_text(raw) catch { + err => { ignore(err); return } +} +let logger = @async_log.build_async_logger(config) +``` + +## `run()` + +```moonbit +pub async fn AsyncLogger::run(self : AsyncLogger[S]) -> Unit +``` + +启动 drain worker。单个 Logger 只能同时拥有一个 worker;已经运行时再次调用会失败,关闭后的 Logger 也不能重新启动。worker 正常在队列关闭时退出;worker 失败时会记录状态并将错误向上传递。 + +## `shutdown()` + +```moonbit +pub async fn AsyncLogger::shutdown( + self : AsyncLogger[S], + clear? : Bool = false, +) -> Unit +``` + +`clear=false` 先等待 idle 再关闭;`clear=true` 立即关闭并放弃待处理记录。两条路径都会等待活动 worker 退出。没有运行 worker 且仍有待处理记录时,`clear=false` 可能无法推进,因此应用应保证先启动 `run()`。 + +## 英文原始 API + +- [`parse_async_logger_build_config_text(...)`](../../api/parse-async-logger-build-config-text.md) +- [`build_async_logger(...)`](../../api/build-async-logger.md) +- [`run()`](../../api/async-logger-run.md) +- [`shutdown()`](../../api/async-logger-shutdown.md) diff --git a/docs/zh/api/basics.md b/docs/zh/api/basics.md new file mode 100644 index 0000000..aa5957a --- /dev/null +++ b/docs/zh/api/basics.md @@ -0,0 +1,55 @@ +# 基础记录 API + +控制台示例依赖以下四个入口:先用 preset 描述输出,再由 `build_logger(...)` 构建运行时 Logger,最后用 `field(...)` 附加结构化上下文。 + +## `console(...)` 与 `json_console(...)` + +```moonbit +pub fn console( + min_level~ : Level = Level::Info, + target~ : String = "", + timestamp~ : Bool = false, +) -> LoggerConfig + +pub fn json_console( + min_level~ : Level = Level::Info, + target~ : String = "", + timestamp~ : Bool = false, +) -> LoggerConfig +``` + +两者都只生成 `LoggerConfig`,不会直接创建运行时 Logger。`console(...)` 适合人读输出,`json_console(...)` 适合按行采集的机器读取输出;默认都不带队列。 + +## `field(...)` + +```moonbit +pub fn field(key : String, value : String) -> Field +``` + +创建一个结构化字段。它保留原始 key/value,不做去重、归一化或校验;应使用稳定字段名,便于下游筛选。 + +```moonbit +logger.info("accepted", fields=[@log.field("user", "alice")]) +``` + +## `build_logger(...)` + +```moonbit +pub fn build_logger(config : LoggerConfig) -> ConfiguredLogger +``` + +这是同步 config 到运行时的桥梁:它先按 `config.sink` 构建 `RuntimeSink`,再应用可选的 `config.queue`。返回值仍保留普通日志方法,以及适用时的队列和文件控制方法。 + +```moonbit +let logger = @log.build_logger( + @log.console(min_level=@log.Level::Info, target="service"), +) +logger.info("ready", fields=[@log.field("port", "8080")]) +``` + +## 英文原始 API + +- [`console(...)`](../../api/console.md) +- [`json_console(...)`](../../api/json-console.md) +- [`field(...)`](../../api/field.md) +- [`build_logger(...)`](../../api/build-logger.md) diff --git a/docs/zh/api/composition.md b/docs/zh/api/composition.md new file mode 100644 index 0000000..afa34a7 --- /dev/null +++ b/docs/zh/api/composition.md @@ -0,0 +1,52 @@ +# Sink 组合 API + +当预设输出不足以表达路由规则时,使用 typed `Logger::new(...)` 和 sink 组合函数。它们接收完整 `Record`,因此仍保留 level、target、message 与 fields。 + +## `Logger::new(...)` + +```moonbit +pub fn Logger::new( + sink : S, + min_level~ : Level = Level::Info, + target~ : String = "", +) -> Logger[S] +``` + +从任意 `Sink` 实现创建 typed Logger。`min_level` 在任何 sink 写入前生效;`target` 是默认值,之后可由 `with_target(...)`、`child(...)` 或单次 `log(..., target=...)` 覆盖。 + +## `fanout_sink(...)` + +```moonbit +pub fn fanout_sink(left : A, right : B) -> FanoutSink[A, B] +``` + +每条记录写入两个目的地,适合控制台加 JSON,或控制台加 callback。右侧获得独立记录副本,两个写入在记录值层面互不影响。 + +## `split_by_level(...)` + +```moonbit +pub fn split_by_level( + left : A, + right : B, + min_level~ : Level = Level::Warn, +) -> SplitSink[A, B] +``` + +达到阈值的记录进入 `left`,低于阈值的记录进入 `right`。典型用法是把 warning/error 单独输出,而 info/debug 留在普通控制台。 + +## `callback_sink(...)` + +```moonbit +pub fn callback_sink( + callback : (Record) -> Unit, +) -> CallbackSink +``` + +将完整结构化 `Record` 交给应用回调。适合测试、自定义桥接与集成;它不自动格式化记录。 + +## 英文原始 API + +- [`Logger::new(...)`](../../api/logger-new.md) +- [`fanout_sink(...)`](../../api/fanout-sink.md) +- [`split_by_level(...)`](../../api/split-by-level.md) +- [`callback_sink(...)`](../../api/callback-sink.md) diff --git a/docs/zh/api/configuration.md b/docs/zh/api/configuration.md new file mode 100644 index 0000000..2bed831 --- /dev/null +++ b/docs/zh/api/configuration.md @@ -0,0 +1,53 @@ +# 配置与队列 API + +这一组 API 将外部 JSON 或 typed config 变成同步 Logger,并明确规定满队列和关闭时的处理方式。 + +## `parse_logger_config_text(...)` + +```moonbit +pub fn parse_logger_config_text(input : String) -> LoggerConfig raise ConfigError +``` + +解析并验证 JSON,但不构建运行时 Logger。缺省字段使用构造器默认值;无效 JSON、错误类型、未知枚举值或空文件路径都会抛出 `ConfigError`。 + +```moonbit +let config = @log.parse_logger_config_text(raw) catch { + err => { ignore(err); return } +} +let logger = @log.build_logger(config) +``` + +## `with_queue(...)`、`QueueConfig` 与溢出策略 + +```moonbit +pub fn with_queue( + config : LoggerConfig, + max_pending~ : Int = 0, + overflow~ : QueueOverflowPolicy = QueueOverflowPolicy::DropNewest, +) -> LoggerConfig + +pub fn QueueConfig::new( + max_pending : Int, + overflow~ : QueueOverflowPolicy = QueueOverflowPolicy::DropNewest, +) -> QueueConfig +``` + +`with_queue(...)` 是 preset 组合入口;`QueueConfig::new(...)` 用于手写 `LoggerConfig`。两者配置同步 `QueuedSink`,不是异步包的 worker 队列。 + +`DropNewest` 丢弃新到记录,`DropOldest` 丢弃最早待处理记录。选择取决于业务更需要保留早期还是最新状态。 + +## `flush()` + +```moonbit +pub fn ConfiguredLogger::flush(self : ConfiguredLogger) -> Bool +``` + +在退出或需要确认输出边界时调用。对于队列和文件 sink,它会走对应运行时 flush 路径;返回值表示该路径是否成功。 + +## 英文原始 API + +- [`parse_logger_config_text(...)`](../../api/parse-logger-config-text.md) +- [`with_queue(...)`](../../api/with-queue.md) +- [`QueueConfig`](../../api/queue-config.md) +- [`QueueOverflowPolicy`](../../api/queue-overflow-policy.md) +- [`flush()`](../../api/configured-logger-flush.md) diff --git a/docs/zh/api/file-output.md b/docs/zh/api/file-output.md new file mode 100644 index 0000000..9ce69fe --- /dev/null +++ b/docs/zh/api/file-output.md @@ -0,0 +1,49 @@ +# 文件输出 API + +文件输出是 native 能力。先检查能力,再创建文件配置,最后在有序退出时 flush 并关闭。 + +## `native_files_supported()` + +```moonbit +pub fn native_files_supported() -> Bool +``` + +native 后端当前返回 `true`,非文件能力后端返回 `false`。这是运行时能力检查,不保证后续文件操作一定成功,路径、权限和文件系统状态仍可能导致失败。 + +## `file(...)` 与 `with_file_rotation(...)` + +```moonbit +pub fn file( + path : String, + min_level~ : Level = Level::Info, + target~ : String = "", + timestamp~ : Bool = false, + append~ : Bool = true, + auto_flush~ : Bool = true, + rotation~ : FileRotation? = None, + text_formatter~ : TextFormatterConfig = default_text_formatter_config(), +) -> LoggerConfig raise ConfigError + +pub fn with_file_rotation( + config : LoggerConfig, + max_bytes : Int, + max_backups~ : Int = 1, +) -> LoggerConfig +``` + +`file(...)` 要求非空路径。`with_file_rotation(...)` 只对 file config 生效;输入不是文件 sink 时原样返回。`max_bytes` 是活动文件上限,`max_backups` 是保留的轮转备份数。 + +## `file_close()` + +```moonbit +pub fn ConfiguredLogger::file_close(self : ConfiguredLogger) -> Bool +``` + +关闭 config 构建的文件 sink。队列文件 sink 会依次 drain、flush、close;只有整条路径成功且期间没有新的写入、flush 或轮转失败时才返回 `true`。非文件 sink 返回 `false`。 + +## 英文原始 API + +- [`native_files_supported()`](../../api/native-files-supported.md) +- [`file(...)`](../../api/file.md) +- [`with_file_rotation(...)`](../../api/with-file-rotation.md) +- [`file_close()`](../../api/configured-logger-file-close.md) diff --git a/docs/zh/api/formatting.md b/docs/zh/api/formatting.md new file mode 100644 index 0000000..a22b613 --- /dev/null +++ b/docs/zh/api/formatting.md @@ -0,0 +1,40 @@ +# 文本格式 API + +文本格式只改变呈现,不改变 `Record` 的结构。需要稳定机器消费时,优先使用 `json_console(...)`。 + +## `text_console(...)` + +```moonbit +pub fn text_console( + min_level~ : Level = Level::Info, + target~ : String = "", + timestamp~ : Bool = false, + text_formatter~ : TextFormatterConfig = default_text_formatter_config(), +) -> LoggerConfig +``` + +生成 `SinkKind::TextConsole` 配置,并复制 formatter 配置。和其他 preset 一样,它不直接构建 Logger,也默认不带队列。 + +## `TextFormatterConfig` 与 `text_formatter(...)` + +`TextFormatterConfig::new(...)` 用于 config-first 路径,控制 timestamp、level、target、fields、分隔符与 template。`text_formatter(...)` 构建直接传给 `text_console_sink(...)` 的运行时 formatter。 + +```moonbit +let config = @log.text_console( + text_formatter=@log.TextFormatterConfig::new( + show_timestamp=false, + template="[{level}] {target} {message} :: {fields}", + ), +) +``` + +## `ColorMode` + +`ColorMode` 控制文本 formatter 的颜色策略。终端样式只服务可读性;业务语义仍应放在 level、target 和 fields 中。 + +## 英文原始 API + +- [`text_console(...)`](../../api/text-console.md) +- [`TextFormatterConfig`](../../api/text-formatter-config.md) +- [`text_formatter(...)`](../../api/text-formatter.md) +- [`ColorMode`](../../api/color-mode.md) diff --git a/docs/zh/api/index.md b/docs/zh/api/index.md new file mode 100644 index 0000000..0760d41 --- /dev/null +++ b/docs/zh/api/index.md @@ -0,0 +1,14 @@ +# 高频 API + +这一层只覆盖 Examples 和 Extend 中直接使用、或应用启动时高频需要的 API。它按使用主题归纳,避免把阅读路径重新拆回一函数一页。 + +| 场景 | 中文说明 | 英文精确参考 | +| --- | --- | --- | +| 第一条结构化日志 | [基础记录](./basics.md) | [完整 API 索引](../../api/index.md) | +| 配置、队列与 flush | [配置与队列](./configuration.md) | [config 分类](../../api/index.md) | +| native 文件输出 | [文件输出](./file-output.md) | [file/sink 分类](../../api/index.md) | +| 终端可读性 | [文本格式](./formatting.md) | [formatter 分类](../../api/index.md) | +| 后台异步处理 | [异步生命周期](./async.md) | [async 分类](../../api/index.md) | +| 多目的地与按 level 路由 | [Sink 组合](./composition.md) | [sink 分类](../../api/index.md) | + +每个中文页面保留高频签名与行为边界;需要全部参数、错误条件或较少使用的公开符号时,沿页面内链接进入英文原始 API。 diff --git a/docs/zh/examples/async.md b/docs/zh/examples/async.md index 7e7f72b..2b1ebed 100644 --- a/docs/zh/examples/async.md +++ b/docs/zh/examples/async.md @@ -44,4 +44,4 @@ moon run examples/async_basic --target native ## 下一步 - 查看[队列](../extend/queue.md)中的溢出与 flush 选择。 -- 英文 API:[`parse_async_logger_build_config_text(...)`](../../api/parse-async-logger-build-config-text.md)、[`build_async_logger(...)`](../../api/build-async-logger.md)、[`run()`](../../api/async-logger-run.md)、[`shutdown()`](../../api/async-logger-shutdown.md)。 +- 阅读[异步生命周期 API](../api/async.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/examples/config.md b/docs/zh/examples/config.md index 1fa5a14..b81e12c 100644 --- a/docs/zh/examples/config.md +++ b/docs/zh/examples/config.md @@ -32,4 +32,4 @@ moon run examples/config_build - 需要明确选择满队列时的行为,阅读[队列](../extend/queue.md)。 - 需要后台 worker 生命周期时,阅读[异步日志生命周期](./async.md)。 -- 英文 API:[`parse_logger_config_text(...)`](../../api/parse-logger-config-text.md)、[`build_logger(...)`](../../api/build-logger.md)、[`with_queue(...)`](../../api/with-queue.md)。 +- 阅读[配置与队列 API](../api/configuration.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/examples/console.md b/docs/zh/examples/console.md index 77f6077..831ac15 100644 --- a/docs/zh/examples/console.md +++ b/docs/zh/examples/console.md @@ -52,4 +52,4 @@ let logger = @log.build_logger( - 需要自定义终端输出时,阅读[文本格式](../extend/formatting.md)。 - 需要由 JSON 配置构建时,阅读[配置构建](./config.md)。 -- 英文 API:[`console(...)`](../../api/console.md)、[`json_console(...)`](../../api/json-console.md)、[`field(...)`](../../api/field.md)、[`build_logger(...)`](../../api/build-logger.md)。 +- 阅读[基础记录 API](../api/basics.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/examples/file-rotation.md b/docs/zh/examples/file-rotation.md index 07f25a6..8d1a8f9 100644 --- a/docs/zh/examples/file-rotation.md +++ b/docs/zh/examples/file-rotation.md @@ -48,4 +48,4 @@ moon run examples/file_rotation --target native - 写入突发较多时,加入[队列](../extend/queue.md)。 - 与 web 目标共享代码前,阅读[目标平台边界](../extend/targets.md)。 -- 英文 API:[`file(...)`](../../api/file.md)、[`with_file_rotation(...)`](../../api/with-file-rotation.md)、[`file_close(...)`](../../api/configured-logger-file-close.md)。 +- 阅读[文件输出 API](../api/file-output.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/extend/composition.md b/docs/zh/extend/composition.md index ae2ccef..07b6a03 100644 --- a/docs/zh/extend/composition.md +++ b/docs/zh/extend/composition.md @@ -34,9 +34,6 @@ let logger = @log.Logger::new( 只有当路由规则属于应用设计时才使用直接 Sink 组合;单一输出时,preset 更容易审查和维护。 -## 英文 API +## API -- [`Logger::new(...)`](../../api/logger-new.md) -- [`fanout_sink(...)`](../../api/fanout-sink.md) -- [`split_by_level(...)`](../../api/split-by-level.md) -- [`callback_sink(...)`](../../api/callback-sink.md) +阅读[Sink 组合 API](../api/composition.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/extend/formatting.md b/docs/zh/extend/formatting.md index bd5ada0..47de85d 100644 --- a/docs/zh/extend/formatting.md +++ b/docs/zh/extend/formatting.md @@ -36,9 +36,6 @@ let formatter = @log.text_formatter( 样式标签是终端呈现元数据,不应作为唯一的业务或运维语义;语义仍应保存在 level、target 与 fields 中。 -## 英文 API +## API -- [`text_console(...)`](../../api/text-console.md) -- [`TextFormatterConfig`](../../api/text-formatter-config.md) -- [`text_formatter(...)`](../../api/text-formatter.md) -- [`ColorMode`](../../api/color-mode.md) +阅读[文本格式 API](../api/formatting.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/extend/queue.md b/docs/zh/extend/queue.md index 204fb60..94e190d 100644 --- a/docs/zh/extend/queue.md +++ b/docs/zh/extend/queue.md @@ -22,9 +22,6 @@ ignore(logger.flush()) 同步队列只是普通运行时 Logger 的一层配置。当 native 异步应用需要 worker 生命周期和批处理时,转到[异步日志生命周期](../examples/async.md)。 -## 英文 API +## API -- [`with_queue(...)`](../../api/with-queue.md) -- [`QueueConfig`](../../api/queue-config.md) -- [`QueueOverflowPolicy`](../../api/queue-overflow-policy.md) -- [`flush()`](../../api/configured-logger-flush.md) +阅读[配置与队列 API](../api/configuration.md);完整契约仍可查询[英文 API 索引](../../api/index.md)。 diff --git a/docs/zh/extend/targets.md b/docs/zh/extend/targets.md index 5818099..edab12f 100644 --- a/docs/zh/extend/targets.md +++ b/docs/zh/extend/targets.md @@ -26,8 +26,6 @@ if @log.native_files_supported() { 异步库在声明目标上提供兼容表面,但可执行 `async fn main` 的入口支持更严格。请把 native-only 可执行示例与可移植库代码分开。 -## 英文 API +## API -- [`native_files_supported()`](../../api/native-files-supported.md) -- [目标验证](../../api/target-verification.md) -- [异步日志生命周期](../examples/async.md) +阅读[文件输出 API](../api/file-output.md)和[异步生命周期](../examples/async.md)。完整目标验证记录仍在[英文 API](../../api/target-verification.md)。 diff --git a/docs/zh/index.md b/docs/zh/index.md index 9c5bffb..03c0747 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -29,4 +29,4 @@ features: 1. 阅读[示例](./examples/index.md),完成从安装到运行 Logger 的全流程。 2. 当基础控制台流程需要更多能力时,阅读[扩展](./extend/index.md)。 -3. 需要精确签名和边界时,查询[英文 API 参考](../api/index.md);API 的中文翻译会按使用频率逐步补充。 +3. 需要高频签名和边界时,查询[中文高频 API](./api/index.md);较少使用的符号仍进入[英文完整 API 参考](../api/index.md)。