From ef39be3346b82991900c970fb25447ddaa38730b Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Thu, 13 Nov 2025 14:23:08 +0100 Subject: [PATCH] =?UTF-8?q?R=C3=A9duction=20du=20logging=20httpx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/utils.py b/src/utils.py index c829f24..eaaf9a5 100644 --- a/src/utils.py +++ b/src/utils.py @@ -11,15 +11,9 @@ from polars import Schema from polars.exceptions import ComputeError from unidecode import unidecode -operators = [ - ["s<", "<"], - ["s>", ">"], - ["i<", "<"], - ["i>", ">"], - ["icontains", "contains"], -] - logger = logging.getLogger("decp.info") +logging.getLogger("httpx").setLevel("WARNING") + logging.basicConfig( format="%(asctime)s %(levelname)-8s %(message)s", level=logging.INFO, @@ -28,6 +22,13 @@ logging.basicConfig( def split_filter_part(filter_part): + operators = [ + ["s<", "<"], + ["s>", ">"], + ["i<", "<"], + ["i>", ">"], + ["icontains", "contains"], + ] print("filter part", filter_part) for operator_group in operators: if operator_group[0] in filter_part: @@ -419,7 +420,8 @@ def track_search(query): "token_auth": os.getenv("MATOMO_TOKEN"), } post( - url=f"https://{os.getenv('MATOMO_DOMAIN')}/matomo.php", params=params + url=f"https://{os.getenv('MATOMO_DOMAIN')}/matomo.php", + params=params, ).raise_for_status()