1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2025-12-15 16:18:14 +08:00

支持在设置页面下载日志

This commit is contained in:
涵曦
2024-06-28 14:34:12 +00:00
parent 03e3312218
commit d6df2f6bfe
4 changed files with 10 additions and 3 deletions

View File

@@ -117,13 +117,15 @@ class XiaoMusic:
os.makedirs(log_path)
if os.path.exists(log_file):
os.remove(log_file)
handler = RotatingFileHandler(self.config.log_file, maxBytes=1024*1024, backupCount=0)
handler = RotatingFileHandler(self.config.log_file, maxBytes=10*1024*1024, backupCount=1)
self.log = logging.getLogger("xiaomusic")
self.log.addHandler(handler)
self.log.setLevel(logging.DEBUG if self.config.verbose else logging.INFO)
debug_config = copy.deepcopy(self.config)
debug_config.account = '******'
debug_config.password = '******'
debug_config.httpauth_username = '******'
debug_config.httpauth_password = '******'
self.log.info(debug_config)
async def poll_latest_ask(self):