From 23eda17bd3f08e7c4ef846fdcb7a76326974f8dd Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 8 Jul 2019 16:55:39 -0600 Subject: [PATCH] Ensure logging is shutdown when exiting --- scripts/wk/log.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/wk/log.py b/scripts/wk/log.py index d8bf82be..b10218fe 100644 --- a/scripts/wk/log.py +++ b/scripts/wk/log.py @@ -1,6 +1,7 @@ '''WizardKit: Log Functions''' # vim: sts=2 sw=2 ts=2 +import atexit import logging import os import pathlib @@ -84,5 +85,8 @@ def start(config=None): # Config logger logging.basicConfig(filename=log_path, **config) + # Register shutdown to run atexit + atexit.register(logging.shutdown) + if __name__ == '__main__': print("This file is not meant to be called directly.")