Skip to content

Instantly share code, notes, and snippets.

@JLarky
Created October 7, 2012 21:52
Show Gist options
  • Save JLarky/3849736 to your computer and use it in GitHub Desktop.
Save JLarky/3849736 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