mirror of
https://github.com/ihmily/DouyinLiveRecorder.git
synced 2025-12-26 05:48:32 +08:00
* 1. 为了防止用户从其他路径运行程序时找不到同目录下的资源。 将配置文件、日志文件、ffmpeg等的路径从 当前路径(./) 改为程序路径(realpath(__file__))。
27 lines
564 B
Python
27 lines
564 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from loguru import logger
|
|
import os, sys
|
|
|
|
script_path = os.path.split(os.path.realpath(sys.argv[0]))[0]
|
|
logger.add(
|
|
f"{script_path}/logs/PlayURL.log",
|
|
level="INFO",
|
|
format="{time:YYYY-MM-DD HH:mm:ss.SSS} | {message}",
|
|
filter=lambda i: i["level"].name == "INFO",
|
|
serialize=False,
|
|
enqueue=True,
|
|
rotation="12:00",
|
|
retention="10 days",
|
|
)
|
|
|
|
logger.add(
|
|
f"{script_path}/logs/DouyinLiveRecorder.log",
|
|
level="WARNING",
|
|
serialize=False,
|
|
enqueue=True,
|
|
rotation="12:00",
|
|
retention="10 days",
|
|
)
|
|
|