Skip to content

Commit a8996c5

Browse files
committed
Log to stderr instead of stdout by default
1 parent e01e264 commit a8996c5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
1010
`Unreleased`_
1111
=============
1212

13+
Changed
14+
-------
15+
* Log to stderr instead of stdout when ``BLEAK_LOGGING`` is enabled.
16+
1317
`0.22.3`_ (2024-10-05)
1418
======================
1519

bleak/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
_logger.addHandler(logging.NullHandler())
7171
if bool(os.environ.get("BLEAK_LOGGING", False)):
7272
FORMAT = "%(asctime)-15s %(name)-8s %(threadName)s %(levelname)s: %(message)s"
73-
handler = logging.StreamHandler(sys.stdout)
73+
handler = logging.StreamHandler(sys.stderr)
7474
handler.setLevel(logging.DEBUG)
7575
handler.setFormatter(logging.Formatter(fmt=FORMAT))
7676
_logger.addHandler(handler)

0 commit comments

Comments
 (0)