Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: log boolean values
Browse files Browse the repository at this point in the history
Closes #915
  • Loading branch information
bbangert committed Jun 12, 2017
1 parent 56ab681 commit 1ed34d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autopush/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion autopush/tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand All @@ -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)
Expand Down

0 comments on commit 1ed34d5

Please sign in to comment.