Skip to content

Commit

Permalink
fix: resolve init_logging issue on Colab (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuangwu5 authored Feb 19, 2025
1 parent a8df2ee commit 238c5bb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mostlyai/qa/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ def init_logging() -> None:
Initialize the logging configuration to stdout.
"""

# log to stdout
handler = logging.StreamHandler(stream=sys.stdout)
handler.setFormatter(logging.Formatter("[%(asctime)s] %(levelname)-7s: %(message)s"))
handler.setLevel(logging.INFO)

_LOG.propagate = False
if not _LOG.hasHandlers():
handler = logging.StreamHandler(stream=sys.stdout)
handler.setFormatter(logging.Formatter("[%(asctime)s] %(levelname)-7s: %(message)s"))
handler.setLevel(logging.INFO)
_LOG.addHandler(handler)
_LOG.setLevel(logging.INFO)
_LOG.propagate = False

0 comments on commit 238c5bb

Please sign in to comment.