couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject twig commit: updated refs/heads/add-couch_log_twig-backend to 72dccc6
Date Wed, 11 May 2016 15:22:29 GMT
Repository: couchdb-twig
Updated Branches:
  refs/heads/add-couch_log_twig-backend [created] 72dccc6f1


Implement couch_log behaviour

couch_log was updated in such a way that the module name of a couch_log
backend has to follow following convention `couch_log_<backend_name>`.


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

Branch: refs/heads/add-couch_log_twig-backend
Commit: 72dccc6f1e982cbe00423fa384305e32a556fd3b
Parents: ec94988
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Wed May 11 08:15:50 2016 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Wed May 11 08:15:50 2016 -0700

----------------------------------------------------------------------
 src/couch_log_twig.erl | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-twig/blob/72dccc6f/src/couch_log_twig.erl
----------------------------------------------------------------------
diff --git a/src/couch_log_twig.erl b/src/couch_log_twig.erl
new file mode 100644
index 0000000..fef3d50
--- /dev/null
+++ b/src/couch_log_twig.erl
@@ -0,0 +1,54 @@
+% 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.
+
+-module(couch_log_twig).
+
+-behaviour(couch_log).
+
+-export([
+    debug/2,
+    info/2,
+    notice/2,
+    warning/2,
+    error/2,
+    critical/2,
+    alert/2,
+    emergency/2,
+    set_level/1
+]).
+
+debug(Fmt, Args) ->
+    twig:log(debug, Fmt, Args).
+
+info(Fmt, Args) ->
+    twig:log(info, Fmt, Args).
+
+notice(Fmt, Args) ->
+    twig:log(notice, Fmt, Args).
+
+warning(Fmt, Args) ->
+    twig:log(warning, Fmt, Args).
+
+error(Fmt, Args) ->
+    twig:log(error, Fmt, Args).
+
+critical(Fmt, Args) ->
+    twig:log(crit, Fmt, Args).
+
+alert(Fmt, Args) ->
+    twig:log(alert, Fmt, Args).
+
+emergency(Fmt, Args) ->
+    twig:log(emerg, Fmt, Args).
+
+set_level(Level) ->
+    twig:set_level(Level).


Mime
View raw message