summaryrefslogtreecommitdiff
path: root/dev-lang/elixir/files/elixir-1.11.4-fix-logger-translator-with-otp-24-11222.patch
blob: 428e7ceb3ab47e6aa6b9000b43f2304e2e10e937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From b1492cb0cfa689c4c098761a375d5cb728d3c175 Mon Sep 17 00:00:00 2001
From: Matteo <mbrancaleoni@gmail.com>
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 <jose.valim@dashbit.co>
---
 .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