diff options
author | Magnus Ahltorp <map@kth.se> | 2015-02-02 16:47:01 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-02-02 16:47:01 +0100 |
commit | 882f789379eb831566fad600a294a4d42b843755 (patch) | |
tree | 228517d96b41ff669ca80aa65490436a9a94a6c6 | |
parent | 68d3e37bd6a848949b6265a67199721cd935127e (diff) |
Added debug logging
-rw-r--r-- | src/catlfish_web.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/catlfish_web.erl b/src/catlfish_web.erl index f3231e4..9869b21 100644 --- a/src/catlfish_web.erl +++ b/src/catlfish_web.erl @@ -14,11 +14,13 @@ start(Options, Module) -> loop(Req, Module) -> "/" ++ Path = Req:get(path), try + Starttime = os:timestamp(), case Req:get(method) of 'GET' -> Query = Req:parse_qs(), lager:debug("GET ~p ~p", [Path, Query]), Result = Module:request(get, Path, Query), + lager:debug("GET finished: ~p us", [timer:now_diff(os:timestamp(), Starttime)]), case Result of none -> Req:respond({404, [{"Content-Type", "text/plain"}], "Page not found"}); @@ -29,6 +31,7 @@ loop(Req, Module) -> Body = Req:recv_body(), lager:debug("POST ~p ~p", [Path, Body]), Result = Module:request(post, Path, Body), + lager:debug("POST finished: ~p us", [timer:now_diff(os:timestamp(), Starttime)]), case Result of none -> Req:respond({404, [{"Content-Type", "text/plain"}], "Page not found"}); |