Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%% Switch debugging output on/off:
- %-define(DBG(Str, Args), ok).
- -define(DBG(Str, Args), io:format(Str, Args)).
- ?DBG("Function fun1 starting... ~n", [])
- ?debugMsg("Function fun1 starting...")
- ?debugFmt("Function fun1 starting...", [])
- -include_lib("eunit/include/eunit.hrl").
- %% If compiled with {d, TEST, true}
- %% This happens automatically during `rebar3 eunit`
- -ifdef(TEST).
- -define(TRACE(Template, Args), io:format(user, "TRACE ~p:~p ~p~n", [?MODULE, ?LINE, lists:flatten(Args)])).
- -else.
- -define(TRACE(_T, _A), void).
- -endif.
- -module(foo).
- -export([ api/1 ]).
- -include("trace.hrl").
- api(Arg) ->
- ?TRACE("Called with Arg ~p~n", [Arg]),
- ok.
Add Comment
Please, Sign In to add comment