Ensure logging is shutdown when exiting
This commit is contained in:
parent
acd92b3e50
commit
23eda17bd3
1 changed files with 4 additions and 0 deletions
|
|
@ -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.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue