Skip to content

Commit

Permalink
0.0.1.4文档添加设置调试日志级别
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnserf-Seed committed Feb 27, 2024
1 parent 3de2c7d commit 7ec9bce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/guide/what-is-f2.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ import f2
f2.APP_CONFIG_FILE_PATH = "conf/app.yaml"
```

## 调试日志级别
## 设置调试日志级别

<<< @/snippets/set-debug.py#set-debug-snippet{5}

支持代码`接口`模式的同时也支持在`CLI`模式中加上`-d`来指定记录日志级别。可选的参数`DEBUG``INFO``WARNING``ERROR`

<<< @/snippets/set-debug.py#cli-debug-snippet

![set-debug](/douyin/set-debug.png)


Expand Down
5 changes: 5 additions & 0 deletions docs/snippets/set-debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
// #endregion set-debug-snippet


// #region cli-debug-snippet
f2 -d WARNING -M post -u https://www.douyin.com/user/MS4wLjABAAAA35iXl5qqCbLKY99pUvxkXzvpSXi8jgUbJ0zR4EuTpcHcS8PHaEb6G9yB6iKR0dNl
// #endregion cli-debug-snippet


// #region log-2-console-snippet
import asyncio
from f2.apps.douyin.handler import DouyinHandler
Expand Down

0 comments on commit 7ec9bce

Please sign in to comment.