Skip to content

Commit

Permalink
silence some loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Mar 23, 2024
1 parent a02e46f commit 6e5f523
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions music_assistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def setup_logger(data_path: str, level: str = "DEBUG"):
logging.getLogger("aiohttp.access").setLevel(logging.WARNING)
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("charset_normalizer").setLevel(logging.WARNING)
logging.getLogger("urllib3.connectionpool").setLevel(logging.ERROR)

sys.excepthook = lambda *args: logging.getLogger(None).exception(
"Uncaught exception",
Expand Down
1 change: 0 additions & 1 deletion music_assistant/server/providers/plex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ async def handle_async_init(self) -> None:
"""Set up the music provider by connecting to the server."""
# silence loggers
logging.getLogger("plexapi").setLevel(self.logger.level + 10)
logging.getLogger("urllib3.connectionpool").setLevel(logging.INFO)
_, library_name = self.config.get_value(CONF_LIBRARY_ID).split(" / ", 1)

def connect() -> PlexServer:
Expand Down
2 changes: 0 additions & 2 deletions music_assistant/server/providers/sonos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ async def setup(
# set-up soco logging
if prov.logger.isEnabledFor(VERBOSE_LOG_LEVEL):
logging.getLogger("soco").setLevel(logging.DEBUG)
logging.getLogger("urllib3.connectionpool").setLevel(logging.INFO)
else:
logging.getLogger("soco").setLevel(prov.logger.level + 10)
logging.getLogger("urllib3.connectionpool").setLevel(logging.WARNING)
await prov.handle_async_init()
return prov

Expand Down

0 comments on commit 6e5f523

Please sign in to comment.