diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index b6b65b6..c960959 100755 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -58,7 +58,7 @@ Use --log-dir= to turn off logging feature.""") class OutLogger(object): def __init__(self, logfile) -> None: self.term = sys.stdout - self.log = open(logfile,"w",encoding='utf-8') + self.log = open(logfile,"w",encoding='utf-8',buffering=1) def __del__(self): self.close() def __enter__(self): @@ -84,7 +84,7 @@ class OutLogger(object): class ErrLogger(OutLogger): def __init__(self, logfile) -> None: self.term = sys.stderr - self.log = open(logfile,"w",encoding='utf-8') + self.log = open(logfile,"w",encoding='utf-8',buffering=1) def close(self): if self.term != None: sys.stderr = self.term @@ -126,14 +126,6 @@ def close_logfile(logdir: str): pass -_print = print # Hook print -_stdout = sys.stdout -def print(*args, **kw): - _print(*args, **kw) - if _stdout != sys.stdout: - sys.stdout.flush() - - # 重写视频文件扫描,消除递归,取消全局变量,新增失败文件列表跳过处理 def movie_lists(root, conf, regexstr): escape_folder = re.split("[,,]", conf.escape_folder())