summaryrefslogtreecommitdiff
path: root/include/common.hrl
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.hrl')
-rw-r--r--include/common.hrl41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/common.hrl b/include/common.hrl
new file mode 100644
index 00000000..2299950d
--- /dev/null
+++ b/include/common.hrl
@@ -0,0 +1,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
+ }).