Fix no print logging after python logging handlers are cleared

This commit is contained in:
allegroai 2021-06-25 22:39:07 +03:00
parent fa6b2e8c7c
commit 164fa357ed

View File

@ -1213,7 +1213,8 @@ class Logger(object):
# noinspection PyProtectedMember # noinspection PyProtectedMember
if not self._skip_console_log() or not self._task._is_remote_main_task(): if not self._skip_console_log() or not self._task._is_remote_main_task():
if self._task_handler: # check if we have a TaskHandler and that it is valid (shutdown will clear the .task_id)
if self._task_handler and self._task_handler.task_id:
# noinspection PyBroadException # noinspection PyBroadException
try: try:
record = self._task.log.makeRecord( record = self._task.log.makeRecord(