Skip to content

Commit

Permalink
将日志写入模式设置为覆盖写入
Browse files Browse the repository at this point in the history
  • Loading branch information
pooneyy committed Sep 1, 2023
1 parent 9c0cfe0 commit 54f9209
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### 更新日志

```
2023.09.01-Based-0.23.07.03.1
基于腾讯云函数“阅后即焚”的特性,将日志写入模式设置为覆盖写入
2023.07.30-Based-0.23.07.03.1
优化重试登录,在登录账户时,为两次重试登录之间,加入一个至少6秒,至多1分钟的延时,避免重试过于频繁。
Expand Down
2 changes: 1 addition & 1 deletion index.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def outputLog(projectName):
log.addHandler(console_handler)
#输出日志到文件
logdir = os.path.join('/tmp', f'{projectName}.log')
file_handler = logging.FileHandler(logdir, encoding='utf-8')
file_handler = logging.FileHandler(logdir, mode='w', encoding='utf-8')
file_handler.formatter = formatter
file_handler.level = logging.DEBUG
log.addHandler(file_handler)
Expand Down

0 comments on commit 54f9209

Please sign in to comment.