Add debugging macros
This commit is contained in:
@@ -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()).
|
||||||
|
|||||||
@@ -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 ->
|
||||||
|
|||||||
Reference in New Issue
Block a user