couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [09/29] twig commit: updated refs/heads/import to 2d56280
Date Mon, 03 Feb 2014 22:12:23 GMT
Simplify API, always use twig:log


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

Branch: refs/heads/import
Commit: 1607ddf71cdbcc43b10f863423998740710289c5
Parents: 5493145
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Tue Mar 8 14:16:31 2011 -0500
Committer: Adam Kocoloski <adam@cloudant.com>
Committed: Tue Mar 8 14:16:31 2011 -0500

----------------------------------------------------------------------
 src/twig.erl | 46 ++++++++--------------------------------------
 1 file changed, 8 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-twig/blob/1607ddf7/src/twig.erl
----------------------------------------------------------------------
diff --git a/src/twig.erl b/src/twig.erl
index a3a9c58..15e303b 100644
--- a/src/twig.erl
+++ b/src/twig.erl
@@ -12,50 +12,18 @@
 
 -module(twig).
 
--export([debug/1, info/1, notice/1, warn/1, err/1, crit/1, alert/1, emerg/1,
-         debug/2, info/2, notice/2, warn/2, err/2, crit/2, alert/2, emerg/2,
-         debug/3, info/3, notice/3, warn/3, err/3, crit/3, alert/3, emerg/3]).
-
--export([set_level/1]).
+-export([log/2, log/3, log/4, set_level/1]).
 
 -include("twig_int.hrl").
 
-debug(Format) ->                    log(debug, Format, [], []).
-debug(Format, Data) ->              log(debug, Format, Data, []).
-debug(Format, Data, Options) ->     log(debug, Format, Data, Options).
-
-info(Format) ->                     log(info, Format, [], []).
-info(Format, Data) ->               log(info, Format, Data, []).
-info(Format, Data, Options) ->      log(info, Format, Data, Options).
-
-notice(Format) ->                   log(notice, Format, [], []).
-notice(Format, Data) ->             log(notice, Format, Data, []).
-notice(Format, Data, Options) ->    log(notice, Format, Data, Options).
-
-warn(Format) ->                     log(warn, Format, [], []).
-warn(Format, Data) ->               log(warn, Format, Data, []).
-warn(Format, Data, Options) ->      log(warn, Format, Data, Options).
-
-err(Format) ->                      log(err, Format, [], []).
-err(Format, Data) ->                log(err, Format, Data, []).
-err(Format, Data, Options) ->       log(err, Format, Data, Options).
-
-crit(Format) ->                     log(crit, Format, [], []).
-crit(Format, Data) ->               log(crit, Format, Data, []).
-crit(Format, Data, Options) ->      log(crit, Format, Data, Options).
-
-alert(Format) ->                    log(alert, Format, [], []).
-alert(Format, Data) ->              log(alert, Format, Data, []).
-alert(Format, Data, Options) ->     log(alert, Format, Data, Options).
-
-emerg(Format) ->                    log(emerg, Format, [], []).
-emerg(Format, Data) ->              log(emerg, Format, Data, []).
-emerg(Format, Data, Options) ->     log(emerg, Format, Data, Options).
-
 set_level(LevelAtom) ->
     application:set_env(twig, {level, twig_util:level(LevelAtom)}).
 
-%% internal
+log(LevelAtom, String) ->
+    log(LevelAtom, String, [], []).
+
+log(LevelAtom, Format, Data) ->
+    log(LevelAtom, Format, Data, []).
 
 log(LevelAtom, Format, Data, _Options) ->
     %% TODO do something useful with options
@@ -69,6 +37,8 @@ log(LevelAtom, Format, Data, _Options) ->
             ok
     end.
 
+%% internal
+
 send_message(Level, Format, Data) ->
     gen_event:sync_notify(error_logger, format(Level, Format, Data)).
 


Mime
View raw message