summaryrefslogtreecommitdiff
path: root/include/common.hrl
blob: 4315a54c64a8205c9e43064115387241b75e78fb (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
42
43
44
45
46
47
48
49

-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
                    }).

%% version 3 of membership state
-record(mem, {header=3,
              node,
              nodes=[],
              clock=[],
              args
             }).