Skip to content

Commit 53b82e0

Browse files
committed
更新docs
1 parent 41b07d3 commit 53b82e0

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

assets/docs/sources/tutorial/11_log_custom.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@
66

77
## 1. 日志完全开启/关闭
88

9-
使用代码:
10-
11-
```python
12-
from jmcomic import disable_jm_log
13-
disable_jm_log()
14-
15-
# 推荐使用 Python 原生的 logging 控制
16-
import logging
17-
logging.getLogger("jmcomic").setLevel(logging.WARNING) # 只显示警告以上的日志
18-
```
199

2010
使用配置:
2111

2212
```yaml
2313
log: false
2414
```
2515
16+
17+
或者使用代码:
18+
19+
```python
20+
from jmcomic import disable_jm_log
21+
disable_jm_log()
22+
```
23+
2624
## 2. 日志过滤,只保留特定topic
2725

2826
使用插件配置
@@ -47,7 +45,7 @@ plugins:
4745
```yaml
4846
plugins:
4947
after_init:
50-
- plugin: client_proxy # 提高移动端的请求效率的插件
48+
- plugin: client_proxy
5149
log: false # 插件自身不打印日志
5250
kwargs:
5351
proxy_client_key: photo_concurrent_fetcher_proxy
@@ -59,8 +57,11 @@ plugins:
5957
根据你的需求复杂度,你可以选择以下方式:
6058
6159
- **方式 A:操作 jm_logger (推荐 / 标准)**
60+
6261
适用于:改变日志输出位置(如文件、监控、后端服务)、调整显示格式、自定义过滤。
62+
6363
- **方式 B:接管 EXECUTOR_LOG (高级 / 深度定制)**
64+
6465
适用于:需要完全重塑日志的分发逻辑,或者将日志直接桥接到不符合标准 logging 协议的第三方系统。
6566
6667
详细参考文档:[模块自定义](./4_module_custom.md#自定义log)

0 commit comments

Comments
 (0)