Merge pull request #51 from sd2k/use-stderr-for-logs

fix: use stderr for logging
This commit is contained in:
Jeremiah Lowin 2024-12-03 14:08:34 -05:00 committed by GitHub
commit e0ead26963
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@
import logging
from typing import Literal
from rich.console import Console
from rich.logging import RichHandler
@ -27,5 +28,7 @@ def configure_logging(
level: the log level to use
"""
logging.basicConfig(
level=level, format="%(message)s", handlers=[RichHandler(rich_tracebacks=True)]
level=level,
format="%(message)s",
handlers=[RichHandler(console=Console(stderr=True), rich_tracebacks=True)],
)