From b1492cb0cfa689c4c098761a375d5cb728d3c175 Mon Sep 17 00:00:00 2001 From: Matteo Date: Tue, 31 Aug 2021 23:46:27 +0200 Subject: [PATCH 3/3] Fix logger translator with otp-24 (#11222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Handle new significant key in sasl reports * Add OTP-24.0 to CI matrix Co-authored-by: José Valim --- .github/workflows/ci.yml | 2 +- lib/logger/lib/logger/translator.ex | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f43a9ff62..a4bc8dbeb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - otp_release: ['OTP-23.0', 'OTP-22.3', 'OTP-22.0', 'OTP-21.3.8', 'OTP-21.0'] + otp_release: ['OTP-24.0', 'OTP-23.0', 'OTP-22.3', 'OTP-22.0', 'OTP-21.3.8', 'OTP-21.0'] development: [false] include: - otp_release: master diff --git a/lib/logger/lib/logger/translator.ex b/lib/logger/lib/logger/translator.ex index d1d7e62f1..8afd79436 100644 --- a/lib/logger/lib/logger/translator.ex +++ b/lib/logger/lib/logger/translator.ex @@ -357,15 +357,22 @@ defp child_info(_min_level, _child) 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) -- 2.31.1