fix bug
This commit is contained in:
parent
cb274d1587
commit
235af9e558
@ -187,6 +187,8 @@ def get_logging(token: str, length: int = 50, logfile: str = "moviepilot.log"):
|
|||||||
# 根据length参数返回不同的响应
|
# 根据length参数返回不同的响应
|
||||||
if length == -1:
|
if length == -1:
|
||||||
# 返回全部日志作为文本响应
|
# 返回全部日志作为文本响应
|
||||||
|
if not log_path.exists():
|
||||||
|
return Response(content="日志文件不存在!", media_type="text/plain")
|
||||||
with open(log_path, 'r', encoding='utf-8') as file:
|
with open(log_path, 'r', encoding='utf-8') as file:
|
||||||
text = file.read()
|
text = file.read()
|
||||||
return Response(content=text, media_type="text/plain")
|
return Response(content=text, media_type="text/plain")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user