diff --git a/.gitignore b/.gitignore index c561d5e..3eba565 100644 --- a/.gitignore +++ b/.gitignore @@ -253,7 +253,7 @@ ipython_config.py # Remove previous ipynb_checkpoints # git rm -r .ipynb_checkpoints/ data/* -history/* +logs/* .idea/* !./data -!./history \ No newline at end of file +!./logs \ No newline at end of file diff --git a/Main_Quality_Relabel_GUI.py b/Main_Quality_Relabel_GUI.py index 137ffee..0d14ba8 100644 --- a/Main_Quality_Relabel_GUI.py +++ b/Main_Quality_Relabel_GUI.py @@ -39,7 +39,9 @@ plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 logger = logging.getLogger() logger.setLevel(logging.NOTSET) realtime = time.strftime('%Y%m%d', time.localtime(time.time())) -fh = logging.FileHandler(Path("history") / (realtime + ".log"), mode='a') +if not os.path.exists(Path("logs")): + os.makedirs(Path("logs")) +fh = logging.FileHandler(Path("logs") / (realtime + ".log"), mode='a') fh.setLevel(logging.NOTSET) fh.setFormatter(logging.Formatter("%(asctime)s: %(message)s")) logger.addHandler(fh)