diff options
| author | tassaron | 2022-04-29 12:15:10 -0400 |
|---|---|---|
| committer | tassaron | 2022-04-29 12:15:10 -0400 |
| commit | dee29d0e700d4812bcf4f1a56d4cb2fb2b8cc0d1 (patch) | |
| tree | 9ce02a15302962f8ba42cfff2806b9f4543463ed | |
| parent | b4fc89cfbeacb9dc99eba01b0dbfb0023709fe40 (diff) | |
delay opening logfile until first call to logger
fix deleting an open file if logger changes after parsing commandline args
on Windows deleting an open file raises an exception
| -rw-r--r-- | src/core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py index bc6f9b4..a3757e6 100644 --- a/src/core.py +++ b/src/core.py @@ -585,9 +585,9 @@ class Core: if os.path.exists(log_): os.remove(log_) - logFile = logging.FileHandler(logFilename) + logFile = logging.FileHandler(logFilename, delay=True) logFile.setLevel(FILE_LOGLVL) - libLogFile = logging.FileHandler(libLogFilename) + libLogFile = logging.FileHandler(libLogFilename, delay=True) libLogFile.setLevel(FILE_LOGLVL) fileFormatter = logging.Formatter( '[%(asctime)s] %(threadName)-10.10s %(name)-23.23s %(levelname)s: ' |
