Use twig for logging
diff --git a/rebar.config b/rebar.config
new file mode 100644
index 0000000..d65fc31
--- /dev/null
+++ b/rebar.config
@@ -0,0 +1,17 @@
+% Copyright 2011 Cloudant
+%
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+% http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+{deps, [
+ {twig, ".*", {git, "https://github.com/cloudant/twig.git", master}}
+]}.
diff --git a/src/rexi_server.erl b/src/rexi_server.erl
index fff2558..16c1d43 100644
--- a/src/rexi_server.erl
+++ b/src/rexi_server.erl
@@ -77,7 +77,7 @@
end;
handle_cast(_, St) ->
- error_logger:error_report({?MODULE, ignored_cast}),
+ twig:log(warn, "rexi_server ignored_cast"),
{noreply, St}.
handle_info({'DOWN', Ref, process, _, normal}, #st{workers=Workers} = St) ->
@@ -122,7 +122,8 @@
put(initial_call, {M,F,length(A)}),
try apply(M, F, A) catch exit:normal -> ok; Class:Reason ->
Stack = clean_stack(),
- error_logger:error_report([{?MODULE, Nonce, {Class, Reason}}, Stack]),
+ erlang:put(nonce, Nonce),
+ twig:log(error, "rexi_server ~p:~p ~100p", [Class, Reason, Stack]),
exit(#error{
timestamp = now(),
reason = {Class, Reason},