From 1632cddcb46df9a01609d11b4b1cb53d48640aaf Mon Sep 17 00:00:00 2001 From: hkc Date: Thu, 26 Jan 2023 13:44:30 +0300 Subject: [PATCH] Pythom lomgimng yummy cool... --- mastoposter/__main__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mastoposter/__main__.py b/mastoposter/__main__.py index 371d4ac..5accd80 100644 --- a/mastoposter/__main__.py +++ b/mastoposter/__main__.py @@ -1,7 +1,14 @@ #!/usr/bin/env python3 from asyncio import run from configparser import ConfigParser, ExtendedInterpolation -from logging import INFO, Formatter, StreamHandler, getLevelName, getLogger +from logging import ( + INFO, + Formatter, + Logger, + StreamHandler, + getLevelName, + getLogger, +) from sys import stdout from mastoposter import execute_integrations, load_integrations_from from mastoposter.integrations import FilteredIntegration @@ -26,6 +33,9 @@ def init_logger(loglevel: int = INFO): stdout_handler.setFormatter(formatter) logger.addHandler(stdout_handler) logger.setLevel(loglevel) + for log in logger.manager.loggerDict.values(): + if isinstance(log, Logger): + log.setLevel(loglevel) async def listen(