mirror of
https://github.com/yshtcn/ServerChanPush2TelegramBot.git
synced 2025-12-14 02:00:26 +08:00
Update ServerChanPush2TelegramBot.py
修改日志命名方式
This commit is contained in:
parent
69cba3a03b
commit
322d9e066c
@ -11,8 +11,8 @@ from logging.handlers import TimedRotatingFileHandler
|
|||||||
current_date = datetime.now().strftime("%Y-%m-%d")
|
current_date = datetime.now().strftime("%Y-%m-%d")
|
||||||
|
|
||||||
# 创建一个处理器,该处理器每天午夜都会创建一个新的日志文件
|
# 创建一个处理器,该处理器每天午夜都会创建一个新的日志文件
|
||||||
handler = TimedRotatingFileHandler(f"received_requests_{current_date}.log", when="midnight", interval=1, backupCount=10, encoding='utf-8')
|
handler = TimedRotatingFileHandler(f"received_requests_StartAt{current_date}.log", when="midnight", interval=1, backupCount=10, encoding='utf-8')
|
||||||
handler.suffix = "%Y-%m-%d"
|
handler.suffix = "To%Y-%m-%d.log"
|
||||||
|
|
||||||
# 配置日志
|
# 配置日志
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user