Skip to content

Commit ec66057

Browse files
authored
Merge pull request #113 from gomoripeti/empty_io_opt
Optimize (not) printing empty string from formatter
2 parents c2a7685 + c76b423 commit ec66057

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/recon_trace.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,10 @@ formatter(Tracer, IOServer, FormatterFun) ->
393393
{'EXIT', Tracer, Reason} ->
394394
exit(Reason);
395395
TraceMsg ->
396-
io:format(IOServer, FormatterFun(TraceMsg), []),
396+
case FormatterFun(TraceMsg) of
397+
"" -> ok;
398+
Formatted -> io:format(IOServer, Formatted, [])
399+
end,
397400
formatter(Tracer, IOServer, FormatterFun)
398401
end.
399402

0 commit comments

Comments
 (0)