Fix logging

This commit is contained in:
Nexus 2024-01-06 21:49:22 +00:00
parent 2563c5d5b6
commit bac7ffb13f

View file

@ -13,8 +13,6 @@ log = logging.getLogger("jimmy")
CONFIG.setdefault("logging", {}) CONFIG.setdefault("logging", {})
logging.basicConfig( logging.basicConfig(
filename=CONFIG["logging"].get("file", "jimmy.log"),
filemode="a",
format="%(asctime)s %(levelname)s %(name)s %(message)s", format="%(asctime)s %(levelname)s %(name)s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S", datefmt="%Y-%m-%d %H:%M:%S",
level=CONFIG["logging"].get("level", "INFO"), level=CONFIG["logging"].get("level", "INFO"),
@ -25,6 +23,12 @@ logging.basicConfig(
show_path=False, show_path=False,
markup=True markup=True
), ),
FileHandler(
filename=CONFIG["logging"].get("file", "jimmy.log"),
mode="a",
encoding="utf-8",
errors="replace"
)
] ]
) )
for logger in CONFIG["logging"].get("suppress", []): for logger in CONFIG["logging"].get("suppress", []):