summaryrefslogtreecommitdiff
path: root/searx/metrics
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-09-06 19:46:08 +0200
committerAlexandre Flament <alex@al-f.net>2021-09-10 21:49:34 +0200
commitb513917ef94d2f18e6db3228363f8089ce1ba08a (patch)
tree7df26e78c31a6785f972d8c68e500098176c9a8a /searx/metrics
parent76e0f6807ccddb12ca9efe3b2343735d6e1777d4 (diff)
downloadsearxng-b513917ef94d2f18e6db3228363f8089ce1ba08a.tar.gz
searxng-b513917ef94d2f18e6db3228363f8089ce1ba08a.zip
[mod] searx.metrics & searx.search: use the engine loggers
metrics & processors use the engine logger
Diffstat (limited to 'searx/metrics')
-rw-r--r--searx/metrics/error_recorder.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/metrics/error_recorder.py b/searx/metrics/error_recorder.py
index c5de008cc..6963cda2f 100644
--- a/searx/metrics/error_recorder.py
+++ b/searx/metrics/error_recorder.py
@@ -5,7 +5,8 @@ from urllib.parse import urlparse
from httpx import HTTPError, HTTPStatusError
from searx.exceptions import (SearxXPathSyntaxException, SearxEngineXPathException, SearxEngineAPIException,
SearxEngineAccessDeniedException)
-from searx import logger, searx_parent_dir
+from searx import searx_parent_dir
+from searx.engines import engines
errors_per_engines = {}
@@ -47,7 +48,7 @@ class ErrorContext:
def add_error_context(engine_name: str, error_context: ErrorContext) -> None:
errors_for_engine = errors_per_engines.setdefault(engine_name, {})
errors_for_engine[error_context] = errors_for_engine.get(error_context, 0) + 1
- logger.debug('%s: %s', engine_name, str(error_context))
+ engines[engine_name].logger.warning('%s', str(error_context))
def get_trace(traces):