mirror of https://github.com/searxng/searxng.git
network: move logger initialization to searx/__init__.py
This commit is contained in:
parent
f50346b131
commit
41a877632b
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue