1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-22 15:54:26 +00:00

Clear log file contents on Empty log

This commit is contained in:
JayZed 2024-09-23 19:17:12 -04:00 committed by GitHub
parent c69be93cd6
commit 5e08898de8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,9 +172,14 @@ def configure_logging(debug=False):
logging.getLogger("rebulk").setLevel(logging.WARNING) logging.getLogger("rebulk").setLevel(logging.WARNING)
logging.getLogger("stevedore.extension").setLevel(logging.CRITICAL) 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(): def empty_log():
fh.doRollover() fh.doRollover()
empty_file(get_log_file_path())
logging.info('BAZARR Log file emptied') logging.info('BAZARR Log file emptied')