Add debugging macros

This commit is contained in:
Alexey Romanov
2010-10-20 18:05:26 +04:00
parent 8545a74c7e
commit ce7e326391
2 changed files with 15 additions and 2 deletions

View File

@@ -1,2 +1,15 @@
-ifdef(DEBUG).
-include_lib("eunit/include/eunit.hrl"). %% for debugging macros
-else.
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl"). %% for debugging macros
-else.
-define(debugMsg(_Message), ok).
-define(debugFmt(_Format, _Data), ok).
-define(debugVal(Expr), Expr).
-define(debugTime(_Text, Expr), Expr).
-endif.
-endif.
-define(NULL_ATOM, null). -define(NULL_ATOM, null).
-type(sql_value() :: number() | ?NULL_ATOM | iodata()). -type(sql_value() :: number() | ?NULL_ATOM | iodata()).

View File

@@ -629,11 +629,11 @@ wait_result(Port) ->
receive receive
%% Messages given at http://www.erlang.org/doc/reference_manual/ports.html %% Messages given at http://www.erlang.org/doc/reference_manual/ports.html
{Port, Reply} -> {Port, Reply} ->
% io:format("Reply: ~p~n", [Reply]), % ?debugFmt("Reply: ~p~n", [Reply]),
Reply; Reply;
{'EXIT', Port, Reason} -> {'EXIT', Port, Reason} ->
error_logger:error_msg("sqlite3 driver port closed with reason~p~n", [Reason]), error_logger:error_msg("sqlite3 driver port closed with reason~p~n", [Reason]),
% io:format("Error: ~p~n", [Reason]), ?debugFmt("Error: ~p~n", [Reason]),
{error, Reason} {error, Reason}
%% ; %% ;
%% _Else -> %% _Else ->