Skip to content

Commit

Permalink
Fix logging crash when commited data is not a string (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardd authored Aug 3, 2020
1 parent 9732d1d commit 89256bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ecto_adapters_dynamodb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ defmodule Ecto.Adapters.DynamoDB do
depth = opts[:depth] || 4
colours = Application.get_env(:ecto_adapters_dynamodb, :log_colours)
d = DateTime.utc_now
formatted_message = "#{d.year}-#{d.month}-#{d.day} #{d.hour}:#{d.minute}:#{d.second} UTC [Ecto dynamo #{level}] #{message}"
formatted_message = "#{d.year}-#{d.month}-#{d.day} #{d.hour}:#{d.minute}:#{d.second} UTC [Ecto dynamo #{level}] #{inspect message}"
{:ok, log_message} = Jason.encode(%{message: formatted_message, attributes: chisel(attributes, depth)})

if Application.get_env(:ecto_adapters_dynamodb, :log_in_colour) do
Expand Down

0 comments on commit 89256bb

Please sign in to comment.