From 1ed34d52337a8cf3de0f051dfe799a202ab11215 Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Mon, 12 Jun 2017 14:29:09 -0700 Subject: [PATCH] fix: log boolean values Closes #915 --- autopush/logging.py | 2 +- autopush/tests/test_logging.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/autopush/logging.py b/autopush/logging.py index fd8820c1..6a62973b 100644 --- a/autopush/logging.py +++ b/autopush/logging.py @@ -172,7 +172,7 @@ def to_fields(kv): reply = dict() for k, v in kv: if (k not in IGNORED_KEYS and - type(v) in (str, unicode, list, int, float)): + type(v) in (str, unicode, list, int, float, bool)): reply[k] = v return reply diff --git a/autopush/tests/test_logging.py b/autopush/tests/test_logging.py index 19f1c526..0296a8e0 100644 --- a/autopush/tests/test_logging.py +++ b/autopush/tests/test_logging.py @@ -50,7 +50,7 @@ def test_sentry_logging(self): pl = PushLogger.setup_logging("Autopush", sentry_dsn=True) pl._output = out _client_info = dict(key='value') - _timings = dict(key2='value') + _timings = dict(key2='value', key3=True) log.failure(format="error", failure=failure.Failure(Exception("eek")), @@ -75,6 +75,7 @@ def check(): payload = json.loads(out.readline()) eq_(payload['Fields']['key'], 'value') eq_(payload['Fields']['key2'], 'value') + eq_(payload['Fields']['key3'], True) self._port.stopListening() pl.stop() d.callback(True)