summaryrefslogtreecommitdiff
path: root/src/plop.erl
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2014-10-24 15:32:58 +0200
committerMagnus Ahltorp <map@kth.se>2014-10-24 15:36:36 +0200
commitb968cb1330ecb13f26e35d948c0511882b89ab2a (patch)
treeeecbb90a07b7b932d0c957ee04d8b0c57e15fb19 /src/plop.erl
parent729c7410504252d7c33e8fd2f43e662725186960 (diff)
Added lager for logging
Diffstat (limited to 'src/plop.erl')
-rw-r--r--src/plop.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plop.erl b/src/plop.erl
index 84d0920..6e15781 100644
--- a/src/plop.erl
+++ b/src/plop.erl
@@ -109,6 +109,7 @@ handle_cast(_Request, State) ->
handle_http_reply(State, {storage_sendentry_http, {OwnRequestId}},
StatusCode, Body) ->
+ lager:debug("http_reply: ~p", [Body]),
{PropList} = (catch jiffy:decode(Body)),
Result = proplists:get_value(<<"result">>, PropList),
case dict:fetch(OwnRequestId, State#state.own_requests) of
@@ -216,6 +217,7 @@ send_storage_entrycommitted(URLBase, EntryHash, TreeLeafHash) ->
[], [{sync, false}]).
store_at_all_nodes(Nodes, {LogEntry, TreeLeafHash, EntryHash}, From, State) ->
+ lager:debug("leafhash ~p", [TreeLeafHash]),
OwnRequestId = make_ref(),
Completion =
@@ -234,6 +236,7 @@ store_at_all_nodes(Nodes, {LogEntry, TreeLeafHash, EntryHash}, From, State) ->
{From, Completion,
storage_nodes_quorum()}}),
+ lager:debug("send requests to ~p", [Nodes]),
RequestIds = [send_storage_sendentry(URLBase, LogEntry, TreeLeafHash)
|| URLBase <- Nodes],
PlopWithRequests =
@@ -259,6 +262,7 @@ handle_call({get, logid}, _From,
{reply, LogID, Plop};
handle_call({add, {LogEntry, TreeLeafHash, EntryHash}}, From, Plop) ->
+ lager:debug("add leafhash ~p", [TreeLeafHash]),
case storage_nodes() of
[] ->
ok = db:add(TreeLeafHash, EntryHash, LogEntry, ht:size()),