Clear log file contents on Empty log

pull/2682/head v1.4.5-beta.3
JayZed 2 months ago committed by GitHub
parent c69be93cd6
commit 5e08898de8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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')

Loading…
Cancel
Save