Skip to content

Commit dbca363

Browse files
committed
fix(safety): 调整日志级别,优化错误信息记录
1 parent 7adf458 commit dbca363

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/common/safety/secure_store.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def write_behind_scenes_settings(d: dict) -> None:
235235
_set_hidden(str(p))
236236
logger.debug(f"写入内幕设置成功:{p}")
237237
except PermissionError as e:
238-
logger.warning(
238+
logger.error(
239239
f"写入内幕设置失败:权限被拒绝,文件可能被占用或无写权限:{p}, 错误:{e}"
240240
)
241241
try:
@@ -251,18 +251,18 @@ def write_behind_scenes_settings(d: dict) -> None:
251251
_set_hidden(str(p))
252252
logger.debug(f"使用临时文件写入内幕设置成功:{p}")
253253
except Exception as temp_e:
254-
logger.warning(f"使用临时文件写入内幕设置也失败:{temp_e}")
254+
logger.error(f"使用临时文件写入内幕设置也失败:{temp_e}")
255255
try:
256256
with open(p, "w", encoding="utf-8") as f:
257257
json.dump(d, f, ensure_ascii=False, indent=4)
258258
logger.warning(f"写入内幕设置降级为明文JSON:{p}")
259259
except Exception as e2:
260-
logger.warning(f"降级写入明文JSON也失败:{e2}")
260+
logger.error(f"降级写入明文JSON也失败:{e2}")
261261
except Exception as e:
262-
logger.exception(f"写入内幕设置失败:{p}, 错误:{e}")
262+
logger.error(f"写入内幕设置失败:{p}, 错误:{e}")
263263
try:
264264
with open(p, "w", encoding="utf-8") as f:
265265
json.dump(d, f, ensure_ascii=False, indent=4)
266266
logger.warning(f"写入内幕设置降级为明文JSON:{p}")
267267
except Exception as e2:
268-
logger.warning(f"降级写入明文JSON也失败:{e2}")
268+
logger.exception(f"降级写入明文JSON也失败:{e2}")

0 commit comments

Comments
 (0)