aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2015-12-03 10:50:46 +0100
committerSiri Hansen <[email protected]>2015-12-03 10:50:46 +0100
commitc2548c79af951a8628b3e44de79652bc923188f0 (patch)
treebde1300a882c05e9bbdd609a85ce13acbb793c9b
parentf96039f1c0cf59c2069f7e1acd1312fa22d6bab9 (diff)
parentc5810d92afe70ab460f23234665b31cba743bc0a (diff)
downloadotp-c2548c79af951a8628b3e44de79652bc923188f0.tar.gz
otp-c2548c79af951a8628b3e44de79652bc923188f0.tar.bz2
otp-c2548c79af951a8628b3e44de79652bc923188f0.zip
Merge branch 'siri/ct_netconfc/log-silent/OTP-13035' into maint
* siri/ct_netconfc/log-silent/OTP-13035: Don't attempt logging when log type is 'silent'
-rw-r--r--lib/common_test/src/ct_conn_log_h.erl22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/common_test/src/ct_conn_log_h.erl b/lib/common_test/src/ct_conn_log_h.erl
index 2dd4fdac05..5239ec1ff8 100644
--- a/lib/common_test/src/ct_conn_log_h.erl
+++ b/lib/common_test/src/ct_conn_log_h.erl
@@ -104,18 +104,26 @@ terminate(_,#state{logs=Logs}) ->
%%%-----------------------------------------------------------------
%%% Writing reports
write_report(_Time,#conn_log{header=false,module=ConnMod}=Info,Data,GL,State) ->
- {LogType,Fd} = get_log(Info,GL,State),
- io:format(Fd,"~n~ts",[format_data(ConnMod,LogType,Data)]);
+ case get_log(Info,GL,State) of
+ {silent,_} ->
+ ok;
+ {LogType,Fd} ->
+ io:format(Fd,"~n~ts",[format_data(ConnMod,LogType,Data)])
+ end;
write_report(Time,#conn_log{module=ConnMod}=Info,Data,GL,State) ->
- {LogType,Fd} = get_log(Info,GL,State),
- io:format(Fd,"~n~ts~ts~ts",[format_head(ConnMod,LogType,Time),
- format_title(LogType,Info),
- format_data(ConnMod,LogType,Data)]).
+ case get_log(Info,GL,State) of
+ {silent,_} ->
+ ok;
+ {LogType,Fd} ->
+ io:format(Fd,"~n~ts~ts~ts",[format_head(ConnMod,LogType,Time),
+ format_title(LogType,Info),
+ format_data(ConnMod,LogType,Data)])
+ end.
write_error(Time,#conn_log{module=ConnMod}=Info,Report,GL,State) ->
case get_log(Info,GL,State) of
- {html,_} ->
+ {LogType,_} when LogType==html; LogType==silent ->
%% The error will anyway be written in the html log by the
%% sasl error handler, so don't write it again.
ok;