删除多余打印
This commit is contained in:
@@ -235,7 +235,6 @@ class LogManager:
|
||||
@classmethod
|
||||
def clearLogs(cls):
|
||||
"""启动时清空 log 目录下所有文件"""
|
||||
print("开始清空日志...")
|
||||
|
||||
# 关闭所有 handler
|
||||
for name, logger in logging.Logger.manager.loggerDict.items():
|
||||
@@ -258,13 +257,11 @@ class LogManager:
|
||||
|
||||
# 清缓存
|
||||
cls._method_loggers.clear()
|
||||
print("日志清空完成")
|
||||
|
||||
@classmethod
|
||||
def upload_all_logs(cls, server_url, token, userId, tenantId):
|
||||
log_path = Path(cls.logDir)
|
||||
if not log_path.exists():
|
||||
print("[upload_all_logs] 日志目录不存在")
|
||||
return False
|
||||
|
||||
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
@@ -286,20 +283,9 @@ class LogManager:
|
||||
files = {
|
||||
"file": (filename, io.BytesIO(zip_bytes), "application/zip")
|
||||
}
|
||||
print(
|
||||
f"[upload_all_logs] "
|
||||
f"server={server_url} (type={type(server_url)}) "
|
||||
f"tenantId={tenantId} (type={type(tenantId)}) "
|
||||
f"userId={userId} (type={type(userId)}) "
|
||||
f"token={token} (type={type(token)})"
|
||||
)
|
||||
|
||||
print("开始上传")
|
||||
# 3) 上传
|
||||
resp = requests.post(server_url, headers=headers, data=data, files=files)
|
||||
print(resp.text)
|
||||
print("上传结束")
|
||||
|
||||
if resp.json()['data']:
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user