diff options
author | JayZed <[email protected]> | 2024-09-23 19:17:12 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-23 19:17:12 -0400 |
commit | 5e08898de82d62ecaf782aa1bb2032ff6304841d (patch) | |
tree | 8c95f415a955cb6391649108ab5673d34ba8e970 | |
parent | c69be93cd6bf9cf4ce6339052e938a3c5420e31f (diff) | |
download | bazarr-5e08898de82d62ecaf782aa1bb2032ff6304841d.tar.gz bazarr-5e08898de82d62ecaf782aa1bb2032ff6304841d.zip |
Clear log file contents on Empty logv1.4.5-beta.3
-rw-r--r-- | bazarr/app/logger.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bazarr/app/logger.py b/bazarr/app/logger.py index 8762d0355..8598912c9 100644 --- a/bazarr/app/logger.py +++ b/bazarr/app/logger.py @@ -172,9 +172,14 @@ def configure_logging(debug=False): logging.getLogger("rebulk").setLevel(logging.WARNING) logging.getLogger("stevedore.extension").setLevel(logging.CRITICAL) +def empty_file(filename): + # Open the log file in write mode to clear its contents + with open(filename, 'w'): + pass # Just opening and closing the file will clear it def empty_log(): fh.doRollover() + empty_file(get_log_file_path()) logging.info('BAZARR Log file emptied') |