Skip to content

Commit

Permalink
Merge pull request #113 from gomoripeti/empty_io_opt
Browse files Browse the repository at this point in the history
Optimize (not) printing empty string from formatter
  • Loading branch information
ferd authored Oct 8, 2024
2 parents c2a7685 + c76b423 commit ec66057
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/recon_trace.erl
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ formatter(Tracer, IOServer, FormatterFun) ->
{'EXIT', Tracer, Reason} ->
exit(Reason);
TraceMsg ->
io:format(IOServer, FormatterFun(TraceMsg), []),
case FormatterFun(TraceMsg) of
"" -> ok;
Formatted -> io:format(IOServer, Formatted, [])
end,
formatter(Tracer, IOServer, FormatterFun)
end.

Expand Down

0 comments on commit ec66057

Please sign in to comment.