Skip to content

Commit

Permalink
Log to stderr instead of stdout by default
Browse files Browse the repository at this point in the history
  • Loading branch information
frereit committed Jan 14, 2025
1 parent e01e264 commit a8996c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
`Unreleased`_
=============

Changed
-------
* Log to stderr instead of stdout when ``BLEAK_LOGGING`` is enabled.

`0.22.3`_ (2024-10-05)
======================

Expand Down
2 changes: 1 addition & 1 deletion bleak/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
_logger.addHandler(logging.NullHandler())
if bool(os.environ.get("BLEAK_LOGGING", False)):
FORMAT = "%(asctime)-15s %(name)-8s %(threadName)s %(levelname)s: %(message)s"
handler = logging.StreamHandler(sys.stdout)
handler = logging.StreamHandler(sys.stderr)
handler.setLevel(logging.DEBUG)
handler.setFormatter(logging.Formatter(fmt=FORMAT))
_logger.addHandler(handler)
Expand Down

0 comments on commit a8996c5

Please sign in to comment.