Bump RLL and improve logging (#5044)

* version bump

* - bump RLL
- logging changes
- player.channel.guild->player.guild
- small cleanup around logging changes

* missed one

* here this one too

* Apply suggestions from code review

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* add one missing player log

* missed one

* Format with Black

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Draper
2021-05-18 23:56:10 +01:00
committed by GitHub
parent c9431f7d90
commit 38da7370ec
19 changed files with 164 additions and 148 deletions

View File

@@ -1,7 +1,7 @@
import logging
import sys
from typing import Final
from typing import Final, Any, Tuple
IS_DEBUG: Final[bool] = "--debug" in sys.argv
@@ -10,9 +10,9 @@ def is_debug() -> bool:
return IS_DEBUG
def debug_exc_log(lg: logging.Logger, exc: Exception, msg: str = None) -> None:
def debug_exc_log(lg: logging.Logger, exc: Exception, msg: str = None, *args: Tuple[Any]) -> None:
"""Logs an exception if logging is set to DEBUG level"""
if lg.getEffectiveLevel() <= logging.DEBUG:
if msg is None:
msg = f"{exc}"
lg.exception(msg, exc_info=exc)
lg.exception(msg, *args, exc_info=exc)