From 7b235a1c36b09cfe2c6b4c97c3b6dad77e51d5ae Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 6 Sep 2021 17:47:28 +0200 Subject: [PATCH] [mod] one logger per engine Suggested-by: @dalf in https://github.com/searxng/searxng/issues/98#issuecomment-849013518 Signed-off-by: Markus Heiser --- manage | 3 ++- searx/engines/__init__.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/manage b/manage index 6f6f1a4fe..b20442260 100755 --- a/manage +++ b/manage @@ -37,7 +37,7 @@ PYLINT_SEARX_DISABLE_OPTION="\ I,C,R,\ W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\ E1136" -PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="supported_languages,language_aliases" +PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="supported_languages,language_aliases,logger" PYLINT_OPTIONS="-m pylint -j 0 --rcfile .pylintrc" help() { @@ -588,6 +588,7 @@ test.pylint() { ( set -e build_msg TEST "[pylint] \$PYLINT_FILES" pyenv.cmd python ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \ + --additional-builtins="${PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES}" \ "${PYLINT_FILES[@]}" build_msg TEST "[pylint] searx/engines" diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index d7defe0b4..1ac675c4c 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -111,6 +111,7 @@ def load_engine(engine_data): if is_missing_required_attributes(engine): return None + engine.logger = logger.getChild(engine_name) return engine