Skip to content

Instantly share code, notes, and snippets.

@rlander
Forked from JLarky/gist:3849736
Created May 11, 2021 21:36
Show Gist options
  • Save rlander/a1d18e6ec693736fddd25ab3f1fb91b7 to your computer and use it in GitHub Desktop.
Save rlander/a1d18e6ec693736fddd25ab3f1fb91b7 to your computer and use it in GitHub Desktop.
erlang ultimate debug macro
% use like ?DEBUG_CALL({simple_test, Status, get_value(X)}).
% or even 2 = ?DEBUG_CALL(if true -> 1+1 end).
-define(DEBUG_CALL(Args), (fun() -> DEBUG_CALL = (Args), error_logger:info_msg("~w:~w -> ~s:~n ~150p~n", [?MODULE, ?LINE, ??Args, DEBUG_CALL]), DEBUG_CALL end)()).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment