1
0
Fork 0

network: move logger initialization to searx/__init__.py

This commit is contained in:
Alexandre Flament 2024-01-05 21:02:37 +00:00
parent f50346b131
commit 41a877632b
2 changed files with 12 additions and 18 deletions

View File

@ -98,6 +98,18 @@ else:
logger = logging.getLogger('searx')
logger.info(settings_load_message)
# set the levels of verbose loggers to WARNING
for logger_name in (
'httpx',
'httpcore.proxy',
'httpcore.connection',
'httpcore.http11',
'httpcore.http2',
'hpack.hpack',
'hpack.table',
):
logging.getLogger(logger_name).setLevel(logging.WARNING)
# log max_request_timeout
max_request_timeout = settings['outgoing']['max_request_timeout']
if max_request_timeout is None:

View File

@ -10,7 +10,6 @@
* TorHTTPClient Inherit from HTTPClientSoftError, check Tor connectivity
"""
import logging
import random
from abc import ABC, abstractmethod
from collections import namedtuple
@ -567,20 +566,3 @@ class TorHTTPClient(HTTPClient):
def _clear_cache():
"""Only for the tests"""
TorHTTPClient._TOR_CHECK_RESULT = {}
def init():
# log
for logger_name in (
'httpx',
'httpcore.proxy',
'httpcore.connection',
'httpcore.http11',
'httpcore.http2',
'hpack.hpack',
'hpack.table',
):
logging.getLogger(logger_name).setLevel(logging.WARNING)
init()