You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/09/18 14:46:47 UTC

twig commit: updated refs/heads/couch_log_behaviour to ea18f4f

Repository: couchdb-twig
Updated Branches:
  refs/heads/couch_log_behaviour [created] ea18f4f63


Implement couch_log behaviour


Project: http://git-wip-us.apache.org/repos/asf/couchdb-twig/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-twig/commit/ea18f4f6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-twig/tree/ea18f4f6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-twig/diff/ea18f4f6

Branch: refs/heads/couch_log_behaviour
Commit: ea18f4f63032bda0f1e5adffc407c76b048382ac
Parents: 2d56280
Author: Robert Newson <rn...@apache.org>
Authored: Fri Sep 18 11:10:52 2015 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Sep 18 13:46:39 2015 +0100

----------------------------------------------------------------------
 src/twig.erl | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-twig/blob/ea18f4f6/src/twig.erl
----------------------------------------------------------------------
diff --git a/src/twig.erl b/src/twig.erl
index e62cd33..488dd28 100644
--- a/src/twig.erl
+++ b/src/twig.erl
@@ -11,11 +11,40 @@
 % the License.
 
 -module(twig).
+-behaviour(couch_log).
 
+%% couch_log interface
+-export([debug/2, info/2, notice/2, warning/2, error/2, critical/2, alert/2, emergency/2]).
+
+%% native twig interface
 -export([log/2, log/3, log/4, set_level/1]).
 
 -include("twig_int.hrl").
 
+debug(Fmt, Args) ->
+    log(debug, Fmt, Args).
+
+info(Fmt, Args) ->
+    log(info, Fmt, Args).
+
+notice(Fmt, Args) ->
+    log(notice, Fmt, Args).
+
+warning(Fmt, Args) ->
+    log(warning, Fmt, Args).
+
+error(Fmt, Args) ->
+    log(error, Fmt, Args).
+
+critical(Fmt, Args) ->
+    log(crit, Fmt, Args).
+
+alert(Fmt, Args) ->
+    log(alert, Fmt, Args).
+
+emergency(Fmt, Args) ->
+    log(emerg, Fmt, Args).
+
 set_level(LevelAtom) ->
     application:set_env(twig, level, twig_util:level(LevelAtom)).