aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2018-11-05 17:09:33 +0100
committerRaimo Niskanen <[email protected]>2018-11-30 10:54:53 +0100
commitd35353f9f237cc5cd6e7adf30ca58a2d9e90c90a (patch)
tree0392045c71aa5796ae40bb5dcf5931dce902ec6c /lib/stdlib
parentf67a1cfcbdb2fbbdd9ff21467d08b61242c2d9cc (diff)
downloadotp-d35353f9f237cc5cd6e7adf30ca58a2d9e90c90a.tar.gz
otp-d35353f9f237cc5cd6e7adf30ca58a2d9e90c90a.tar.bz2
otp-d35353f9f237cc5cd6e7adf30ca58a2d9e90c90a.zip
Filter gen_server State in crash sys:log
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/src/gen_server.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/stdlib/src/gen_server.erl b/lib/stdlib/src/gen_server.erl
index 7a415c7620..c7b6406f54 100644
--- a/lib/stdlib/src/gen_server.erl
+++ b/lib/stdlib/src/gen_server.erl
@@ -890,7 +890,7 @@ error_info(Reason, Name, From, Msg, Mod, State, Debug) ->
name=>Name,
last_message=>Msg,
state=>format_status(terminate, Mod, get(), State),
- log=>Log,
+ log=>format_log_state(Mod, Log),
reason=>Reason,
client_info=>client_stacktrace(From)},
#{domain=>[otp],
@@ -979,15 +979,24 @@ format_status(Opt, StatusData) ->
[PDict, SysState, Parent, Debug, [Name, State, Mod, _Time, _HibernateAfterTimeout]] = StatusData,
Header = gen:format_status_header("Status for generic server", Name),
Log = sys:get_log(Debug),
- Specfic = case format_status(Opt, Mod, PDict, State) of
+ Specific = case format_status(Opt, Mod, PDict, State) of
S when is_list(S) -> S;
S -> [S]
end,
[{header, Header},
{data, [{"Status", SysState},
{"Parent", Parent},
- {"Logged events", Log}]} |
- Specfic].
+ {"Logged events", format_log_state(Mod, Log)}]} |
+ Specific].
+
+format_log_state(Mod, Log) ->
+ [case Event of
+ {out,Msg,From,State} ->
+ {out,Msg,From,format_status(terminate, Mod, get(), State)};
+ {noreply,State} ->
+ {noreply,format_status(terminate, Mod, get(), State)};
+ _ -> Event
+ end || Event <- Log].
format_status(Opt, Mod, PDict, State) ->
DefStatus = case Opt of