[fix] logs: Proper member name mapping for ValidLogLevels

`_member_names_` is not part of the Enum documented public API, instead
use `__members__`.
This commit is contained in:
y0nei 2023-10-03 10:32:34 +02:00
parent 3c91f44cc6
commit bf7d5cd432
No known key found for this signature in database
GPG key ID: 89A8EAB009DF28DC

View file

@ -40,7 +40,7 @@ LOG_FORMAT_DEBUG = '%(levelname)-7s %(name)-30.30s: %(message)s'
LOG_FORMAT_PROD = '%(asctime)-15s %(levelname)s:%(name)s: %(message)s'
searx_loglevel = settings['general']['log_level']
if searx_loglevel.upper() in ValidLogLevels._member_names_:
if searx_loglevel.upper() in list(ValidLogLevels.__members__):
LOG_LEVEL_PROD = ValidLogLevels[searx_loglevel.upper()].name
else:
LOG_LEVEL_PROD = logging.WARNING