This commit is contained in:
allegroai 2021-02-21 15:00:15 +02:00
parent 132e76cfb9
commit cf3c6ba815
2 changed files with 8 additions and 6 deletions

View File

@ -158,8 +158,6 @@ class BackgroundLogService(BackgroundMonitor):
# noinspection PyProtectedMember
TaskHandler._log_stderr(
"{}\nWARNING: trains.log - Failed logging task to backend ({:d} lines)".format(ex, len(buffer)))
import traceback
traceback.print_stack()
def flush(self):
if self.is_alive():
@ -230,11 +228,10 @@ class TaskHandler(BufferingHandler):
TaskHandler.__once = True
# if we passed the max buffer
return self.counter >= self.capacity and self._background_log and \
self._background_log_size >= self.capacity
return (self.counter >= self.capacity and self._background_log and
self._background_log_size >= self.capacity)
def flush(self):
import traceback
if self._task_id is None:
return
self.counter = 0

View File

@ -1178,7 +1178,12 @@ class Logger(object):
@classmethod
def _remove_std_logger(cls):
# noinspection PyBroadException
try:
StdStreamPatch.remove_std_logger()
except Exception:
return False
return True
def _console(self, msg, level=logging.INFO, omit_console=False, *args, **_):
# type: (str, int, bool, Any, Any) -> None