summaryrefslogtreecommitdiff
path: root/searx/search.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-01-09 04:13:05 +0100
committerAdam Tauber <asciimoo@gmail.com>2015-01-09 04:13:05 +0100
commit299a80a1eb2eecb80f5c50da261a9eab1900b572 (patch)
tree89cacdaa961788e86cfe3ec228b0b66ee77eb438 /searx/search.py
parent425a576f28e1afd3d8e65097ecfe225a25d9eafb (diff)
downloadsearxng-299a80a1eb2eecb80f5c50da261a9eab1900b572.tar.gz
searxng-299a80a1eb2eecb80f5c50da261a9eab1900b572.zip
[enh] using the logger
Diffstat (limited to 'searx/search.py')
-rw-r--r--searx/search.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/searx/search.py b/searx/search.py
index fbbf3fe41..a31d8eace 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -29,8 +29,11 @@ from searx.engines import (
from searx.languages import language_codes
from searx.utils import gen_useragent
from searx.query import Query
+from searx import logger
+logger = logger.getChild('search')
+
number_of_searches = 0
@@ -42,7 +45,7 @@ def search_request_wrapper(fn, url, engine_name, **kwargs):
engines[engine_name].stats['errors'] += 1
# print engine name and specific error message
- print('[E] Error with engine "{0}":\n\t{1}'.format(
+ logger.warning('engine crash: {0}\n\t{1}'.format(
engine_name, str(e)))
return
@@ -66,7 +69,7 @@ def threaded_requests(requests):
remaining_time = max(0.0, timeout_limit - (time() - search_start))
th.join(remaining_time)
if th.isAlive():
- print('engine timeout: {0}'.format(th._engine_name))
+ logger.warning('engine timeout: {0}'.format(th._engine_name))
# get default reqest parameter