Ensure we have at least one logging root handler

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
This commit is contained in:
Sergey Kizunov 2018-01-30 03:52:56 -06:00
parent 3da9b8dd33
commit e84801a381
No known key found for this signature in database
GPG key ID: 9CEE55A1DE138AAB

View file

@ -933,6 +933,12 @@ def shutdown_multiprocessing_logging():
logging.root.removeHandler(__MP_LOGGING_QUEUE_HANDLER)
__MP_LOGGING_QUEUE_HANDLER = None
__MP_LOGGING_CONFIGURED = False
if not logging.root.handlers:
# Ensure we have at least one logging root handler so
# something can handle logging messages. This case should
# only occur on Windows since on Windows we log to console
# and file through the Multiprocessing Logging Listener.
setup_console_logger()
finally:
logging._releaseLock()