Add rich handler for better-formatted debug logging (#1627)

This commit is contained in:
Jonathan Wren 2022-10-31 08:55:23 -07:00 committed by GitHub
parent 44e2ace833
commit cd47070894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View file

@ -8,6 +8,7 @@ from typing import Callable
import colorama
import xdg.BaseDirectory
from rich.pretty import pretty_repr
from ruamel.yaml import YAML
from ruamel.yaml import constructor
@ -126,12 +127,15 @@ def scope_config(config, journal_name):
if type(journal_conf) is dict:
# We can override the default config on a by-journal basis
logging.debug(
"Updating configuration with specific journal overrides %s", journal_conf
"Updating configuration with specific journal overrides:\n%s",
pretty_repr(journal_conf),
)
config.update(journal_conf)
else:
# But also just give them a string to point to the journal file
config["journal"] = journal_conf
logging.debug("Scoped config:\n%s", pretty_repr(config))
return config