mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-21 23:32:31 +00:00
Clear log file contents on Empty log
This commit is contained in:
parent
c69be93cd6
commit
5e08898de8
1 changed files with 5 additions and 0 deletions
|
@ -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…
Reference in a new issue