summaryrefslogtreecommitdiff
path: root/include/common.hrl
blob: 2299950d637d9d3f1ab8d3e4621eabd6f5fd3bf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

-include_lib("eunit/include/eunit.hrl").

-define(fmt(Msg, Args), lists:flatten(io_lib:format(Msg, Args))).
-define(infoFmt(Msg, Args), error_logger:info_msg(Msg, Args)).
-define(infoMsg(Msg), error_logger:info_msg(Msg)).


%% from couch_db.hrl
-ifndef(LOG_DEBUG).
-define(LOG_DEBUG(Format, Args),
    showroom_log:message(debug, Format, Args)).
-endif.

-ifndef(LOG_INFO).
-define(LOG_INFO(Format, Args),
    showroom_log:message(info, Format, Args)).
-endif.

-ifndef(LOG_ERROR).
-define(LOG_ERROR(Format, Args),
    showroom_log:message(error, Format, Args)).
-endif.

%% -define(PMAP(F,L), lists:map(F,L)).
-define(PMAP(F,L), showroom_utils:pmap(F,L)).


%%
%% membership2 (in here for separate testing module)
%%

-define(VERSION,2).

-record(membership, {header=?VERSION,
                     node,
                     nodes,
                     partitions,
                     version,
                     fullmap
                    }).