mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +00:00
PEP8
This commit is contained in:
parent
132e76cfb9
commit
cf3c6ba815
@ -158,8 +158,6 @@ class BackgroundLogService(BackgroundMonitor):
|
|||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
TaskHandler._log_stderr(
|
TaskHandler._log_stderr(
|
||||||
"{}\nWARNING: trains.log - Failed logging task to backend ({:d} lines)".format(ex, len(buffer)))
|
"{}\nWARNING: trains.log - Failed logging task to backend ({:d} lines)".format(ex, len(buffer)))
|
||||||
import traceback
|
|
||||||
traceback.print_stack()
|
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
if self.is_alive():
|
if self.is_alive():
|
||||||
@ -230,11 +228,10 @@ class TaskHandler(BufferingHandler):
|
|||||||
TaskHandler.__once = True
|
TaskHandler.__once = True
|
||||||
|
|
||||||
# if we passed the max buffer
|
# if we passed the max buffer
|
||||||
return self.counter >= self.capacity and self._background_log and \
|
return (self.counter >= self.capacity and self._background_log and
|
||||||
self._background_log_size >= self.capacity
|
self._background_log_size >= self.capacity)
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
import traceback
|
|
||||||
if self._task_id is None:
|
if self._task_id is None:
|
||||||
return
|
return
|
||||||
self.counter = 0
|
self.counter = 0
|
||||||
|
@ -1178,7 +1178,12 @@ class Logger(object):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _remove_std_logger(cls):
|
def _remove_std_logger(cls):
|
||||||
StdStreamPatch.remove_std_logger()
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
|
StdStreamPatch.remove_std_logger()
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def _console(self, msg, level=logging.INFO, omit_console=False, *args, **_):
|
def _console(self, msg, level=logging.INFO, omit_console=False, *args, **_):
|
||||||
# type: (str, int, bool, Any, Any) -> None
|
# type: (str, int, bool, Any, Any) -> None
|
||||||
|
Loading…
Reference in New Issue
Block a user