Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
doomedraven committed Sep 13, 2023
1 parent 050d75f commit b64b724
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ def set_formatter_fmt(task_id=None):


def init_logging(auto=False, tid=0, debug=False):

# Pyattck creates root logger which we don't want. So we must use this dirty hack to remove it
# If basicConfig was already called by something and had a StreamHandler added,
# replace it with a ConsoleHandler.
for h in log.handlers[:]:
if isinstance(h, logging.StreamHandler) and h.stream == sys.stderr:
log.removeHandler(h)
h.close()

ch = ConsoleHandler()
ch.setFormatter(FORMATTER)
log.addHandler(ch)
Expand Down

0 comments on commit b64b724

Please sign in to comment.