From df65074a8143cebec810dfb91cafa43f19dcdbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 23 Apr 2021 17:16:10 +0200 Subject: [PATCH] Handle new significant key in sasl reports --- lib/logger/lib/logger/translator.ex | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/logger/lib/logger/translator.ex b/lib/logger/lib/logger/translator.ex index 03e574f31c..afc8f2a497 100644 --- a/lib/logger/lib/logger/translator.ex +++ b/lib/logger/lib/logger/translator.ex @@ -355,15 +355,22 @@ defmodule Logger.Translator do [] end - defp child_debug(:debug, restart_type: restart, shutdown: shutdown, child_type: type) do - ["\nRestart: ", inspect(restart), "\nShutdown: ", inspect(shutdown)] ++ - ["\nType: ", inspect(type)] + defp child_debug(:debug, opts) do + for {key, value} <- opts do + child_debug_key(key, value) + end end defp child_debug(_min_level, _child) do [] end + defp child_debug_key(:restart_type, value), do: ["\nRestart: " | inspect(value)] + defp child_debug_key(:shutdown, value), do: ["\nShutdown: " | inspect(value)] + defp child_debug_key(:child_type, value), do: ["\nType: " | inspect(value)] + defp child_debug_key(:significant, value), do: if(value, do: "\nSignificant: true", else: []) + defp child_debug_key(_, _), do: [] + defp report_crash(min_level, [[{:initial_call, initial_call} | crashed], linked]) do mfa = initial_call_to_mfa(initial_call) report_crash(min_level, crashed, [{:initial_call, mfa}], linked)