Add a custom Logger class with both verbose and trace levels. (#5613)

* rearrange commits

* Update redbot/setup.py

* change rich log level colours
This commit is contained in:
Draper
2022-03-15 20:20:37 +00:00
committed by GitHub
parent 7d716a2d67
commit 593eeb5362
6 changed files with 63 additions and 10 deletions

View File

@@ -282,7 +282,6 @@ class RedRichHandler(RichHandler):
def init_logging(level: int, location: pathlib.Path, cli_flags: argparse.Namespace) -> None:
root_logger = logging.getLogger()
base_logger = logging.getLogger("red")
base_logger.setLevel(level)
dpy_logger = logging.getLogger("discord")
@@ -298,6 +297,8 @@ def init_logging(level: int, location: pathlib.Path, cli_flags: argparse.Namespa
"log.time": Style(dim=True),
"logging.level.warning": Style(color="yellow"),
"logging.level.critical": Style(color="white", bgcolor="red"),
"logging.level.verbose": Style(color="magenta", italic=True, dim=True),
"logging.level.trace": Style(color="white", italic=True, dim=True),
"repr.number": Style(color="cyan"),
"repr.url": Style(underline=True, italic=True, bold=False, color="cyan"),
}