Created
October 7, 2012 21:52
-
-
Save JLarky/3849736 to your computer and use it in GitHub Desktop.
erlang ultimate debug macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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