diff options
-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') |