Skip to content

Commit 2cb2f09

Browse files
committed
logging: set root logger level/handler
This keeps the root logger from swallowing logs, for example logs emitted by plugins and dependencies (such as the MusicBrainz API client).
1 parent 0fec858 commit 2cb2f09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

beets/ui/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,10 +1638,16 @@ def _configure(options):
16381638
config.set_args(options)
16391639

16401640
# Configure the logger.
1641+
root_logger = logging.getLogger()
1642+
if not root_logger.handlers:
1643+
root_logger.addHandler(logging.StreamHandler())
1644+
16411645
if config["verbose"].get(int):
16421646
log.set_global_level(logging.DEBUG)
1647+
root_logger.setLevel(logging.DEBUG)
16431648
else:
16441649
log.set_global_level(logging.INFO)
1650+
root_logger.setLevel(logging.INFO)
16451651

16461652
if overlay_path:
16471653
log.debug(

0 commit comments

Comments
 (0)