Ensure logging is shutdown when exiting

This commit is contained in:
2Shirt 2019-07-08 16:55:39 -06:00
parent acd92b3e50
commit 23eda17bd3
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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.")