From 8796c9892ad8f1d861bb9bfcff4a5b1bbc3da916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 21 Mar 2018 10:41:33 +0100 Subject: [PATCH] misc: do not log invalid json content error if log_errors is False (#22661) --- combo/data/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/combo/data/models.py b/combo/data/models.py index a6e43b81..fea504df 100644 --- a/combo/data/models.py +++ b/combo/data/models.py @@ -961,7 +961,10 @@ class JsonCellBase(CellBase): except ValueError: extra_context[data_key + '_error'] = 'invalid_json' logger = logging.getLogger(__name__) - logger.error('invalid json content (%s)', url) + if log_errors: + logger.error('invalid json content (%s)', url) + else: + logger.debug('invalid json content (%s)', url) continue elif json_response.headers.get('content-type') == 'application/json': try: