Commit a85f0594 authored by Duncan McGreggor's avatar Duncan McGreggor

Added aliases for warn, fail/failure.

parent d2df5dc2
# logjam
[![Build Status][travis badge]][travis]
[![LFE Versions][lfe badge]][lfe]
[![Erlang Versions][erlang badge]][versions]
[![Tags][github tags badge]][github tags]
[![Build Status][travis badge]][travis]
[![LFE Versions][lfe badge]][lfe]
[![Erlang Versions][erlang badge]][versions]
[![Tags][github tags badge]][github tags]
[![Downloads][hex downloads]][hex package]
[![Project Logo][logo]][logo-large]
......@@ -97,8 +97,8 @@ appropriate lager configuration options set. For instance:
Any legal lager configuration will work (as long as you translate it into LFE
syntax first!).
If you'd like to use use the custom log formatter (modeled after logging
formats common in Clojure applications), you can configure your handler like
If you'd like to use use the custom log formatter (modeled after logging
formats common in Clojure applications), you can configure your handler like
the following:
```cl
......@@ -188,11 +188,11 @@ Now you'll be able to use logjam. The following log types are defined:
* `debug`
* `info`
* `notice`
* `warning`
* `warning` (supported with `warn` alias)
* `error` (supported by both sets of `error` and `err` functions)
* `critical`
* `alert`
* `emergency`
* `emergency` (supported with `fail` and `faiulre` aliases)
Each of these has arity 1, 2, 3, and 4 functions of the same name:
* arity 1: pass a message
......
......@@ -47,6 +47,9 @@
(defun warning (msg)
(log 'warning msg))
(defun warn (msg)
(log 'warning msg))
(defun err (msg)
(log 'error msg))
......@@ -62,6 +65,12 @@
(defun emergency (msg)
(log 'emergency msg))
(defun failure (msg)
(log 'emergency msg))
(defun fail (msg)
(log 'emergency msg))
;;; Log function wrappers with args for (io_lib:format ...)
(defun debug (format args)
(log-format 'debug format args))
......@@ -75,6 +84,9 @@
(defun warning (format args)
(log-format 'warning format args))
(defun warn (format args)
(log-format 'warning format args))
(defun err (format args)
(log-format 'error format args))
......@@ -90,6 +102,12 @@
(defun emergency (format args)
(log-format 'emergency format args))
(defun failure (format args)
(log-format 'emergency format args))
(defun fail (format args)
(log-format 'emergency format args))
;;; Log functions with mod/func and message arguments
(defun debug (mod func msg)
(log-mod-func 'debug mod func msg))
......@@ -103,6 +121,9 @@
(defun warning (mod func msg)
(log-mod-func 'warning mod func msg))
(defun warn (mod func msg)
(log-mod-func 'warning mod func msg))
(defun err (mod func msg)
(log-mod-func 'error mod func msg))
......@@ -118,6 +139,12 @@
(defun emergency (mod func msg)
(log-mod-func 'emergency mod func msg))
(defun failure (mod func msg)
(log-mod-func 'emergency mod func msg))
(defun fail (mod func msg)
(log-mod-func 'emergency mod func msg))
;;; Log functions with mod/func and format arguments for (io_lib:format ...)
(defun debug (mod func format args)
(log-mod-func-format 'debug mod func format args))
......@@ -146,6 +173,12 @@
(defun emergency (mod func format args)
(log-mod-func-format 'emergency mod func format args))
(defun failure (mod func format args)
(log-mod-func-format 'emergency mod func format args))
(defun fail (mod func format args)
(log-mod-func-format 'emergency mod func format args))
;; Lager wrapper funcs
(defun set-level (log-level)
(set-level 'lager_console_backend log-level))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment