Skip to content

Commit

Permalink
Fix JSON message serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Nov 9, 2017
1 parent c814aaf commit 0f7c13d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion watchtower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ def emit(self, message):
logGroupName=self.log_group, logStreamName=stream_name)
self.sequence_tokens[stream_name] = None

msg = dict(timestamp=int(message.created * 1000), message=self.format(message))
msg = dict(timestamp=int(message.created * 1000), message=message)
if isinstance(msg["message"], collections.Mapping):
msg["message"] = json.dumps(msg["message"])
msg["message"] = self.format(msg["message"])
if self.use_queues:
if stream_name not in self.queues:
self.queues[stream_name] = queue.Queue()
Expand Down

0 comments on commit 0f7c13d

Please sign in to comment.