ydf0509 / nb_log

pip install nb_log 各种日志handler和自动转化项目的任意print的效果。日志自动彩色炫酷,可点击控制台的日志自动精确跳转到pycharm的文件和行号。文件日志多进程切割安全。在10个最重要方面全方位超过loguru
389 stars 73 forks source link

I/O operation on closed file错误 #65

Closed sunny6chen closed 2 weeks ago

sunny6chen commented 6 months ago
  1. log_file_handler_type == 2时 会出现I/O operation on closed file的错误。

系统信息:MACOS 版本:nb-log= "~=12.3"

日志: --- Logging error --- Traceback (most recent call last): File "/nb_log/handlers.py", line 684, in emit self.fp.write(msg + '\n') ValueError: I/O operation on closed file.

ydf0509 commented 6 months ago

日志写入进去没?

ydf0509 commented 6 months ago

这个应该没影响吧,你按了ctrl c 或者代码异常结束,不影响写入日志

sunny6chen commented 6 months ago

没有写入到日志文件内, 这是在fastapi的RequestRoute方法内,记录请求日志时,出现的错误

ydf0509 commented 6 months ago

你用hanlder 6试试呢

sunny6chen commented 6 months ago

其它type没问题,就2会出现上方错误