From f7f1ae0af18d117f659a53b316859ff2fc98abd8 Mon Sep 17 00:00:00 2001 From: Solomon White Date: Fri, 1 May 2020 11:17:16 -0600 Subject: [PATCH] don't blow up if passed an unexpected value --- lib/logster/string_formatter.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/logster/string_formatter.ex b/lib/logster/string_formatter.ex index f7aa88b..d942214 100644 --- a/lib/logster/string_formatter.ex +++ b/lib/logster/string_formatter.ex @@ -13,4 +13,5 @@ defmodule Logster.StringFormatter do defp format_value(value) when is_float(value), do: :erlang.float_to_binary(value, decimals: 3) defp format_value(value) when is_atom(value) or is_integer(value), do: to_string(value) defp format_value(value) when is_map(value), do: Jason.encode!(value) + defp format_value(_), do: "(unprintable)" end