Skip to content

Commit

Permalink
Update stderr logger handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jlubken committed Dec 27, 2021
1 parent e578450 commit f950864
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/dsdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from functools import wraps
from json import dump as json_dump
from json import load as json_load
from logging import INFO, Formatter, StreamHandler, getLogger
from logging import ERROR, INFO, Formatter, StreamHandler, getLogger
from pickle import dump as pickle_dump
from pickle import load as pickle_load
from sys import stdout
from sys import stderr, stdout
from time import perf_counter_ns
from time import sleep as default_sleep
from typing import Any, Callable, Generator, Sequence
Expand Down Expand Up @@ -49,7 +49,12 @@ def configure_logger(name, level=INFO):
)
)
handler = StreamHandler(stdout)
handler.setLevel(level)
handler.setLevel(INFO)
handler.setFormatter(Formatter(formatter_string))
result.addHandler(handler)

handler = StreamHandler(stderr)
handler.setLevel(ERROR)
handler.setFormatter(Formatter(formatter_string))
result.addHandler(handler)
return result
Expand Down

0 comments on commit f950864

Please sign in to comment.