fix logging
This commit is contained in:
parent
5da3406647
commit
71c3dbcf3c
@ -111,8 +111,10 @@ def get_logging(token: str):
|
||||
|
||||
def log_generator():
|
||||
log_path = settings.LOG_PATH / 'moviepilot.log'
|
||||
texts = tailer.tail(open(log_path, 'r'), 50)
|
||||
yield 'data: %s\n\n' % '\n'.join(texts)
|
||||
# 读取文件末尾50行,不使用tailer模块
|
||||
with open(log_path, 'r') as f:
|
||||
for line in f.readlines()[-50:]:
|
||||
yield 'data: %s\n\n' % line
|
||||
while True:
|
||||
for text in tailer.follow(open(log_path, 'r')):
|
||||
yield 'data: %s\n\n' % (text or '')
|
||||
|
@ -144,7 +144,7 @@ class TorrentHelper:
|
||||
file_list = [torrentinfo.name]
|
||||
else:
|
||||
file_list = [fileinfo.name for fileinfo in torrentinfo.files]
|
||||
logger.info(f"{torrent_path.stem} -> 目录:{folder_name},文件清单:{file_list}")
|
||||
logger.debug(f"{torrent_path.stem} -> 目录:{folder_name},文件清单:{file_list}")
|
||||
return folder_name, file_list
|
||||
except Exception as err:
|
||||
logger.error(f"种子文件解析失败:{err}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user