Skip to content

Commit 238c5bb

Browse files
authored
fix: resolve init_logging issue on Colab (#115)
1 parent a8df2ee commit 238c5bb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

mostlyai/qa/logging.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@ def init_logging() -> None:
2323
Initialize the logging configuration to stdout.
2424
"""
2525

26-
# log to stdout
27-
handler = logging.StreamHandler(stream=sys.stdout)
28-
handler.setFormatter(logging.Formatter("[%(asctime)s] %(levelname)-7s: %(message)s"))
29-
handler.setLevel(logging.INFO)
30-
26+
_LOG.propagate = False
3127
if not _LOG.hasHandlers():
28+
handler = logging.StreamHandler(stream=sys.stdout)
29+
handler.setFormatter(logging.Formatter("[%(asctime)s] %(levelname)-7s: %(message)s"))
30+
handler.setLevel(logging.INFO)
3231
_LOG.addHandler(handler)
3332
_LOG.setLevel(logging.INFO)
34-
_LOG.propagate = False

0 commit comments

Comments
 (0)