Minimal Clojure logging library, mainly for scripting
There are quite a few logging libraries already available, so why another one? Some goals:
Leiningen/Boot
[ndevreeze/logger "0.4.0"]
Clojure CLI/deps.edn
ndevreeze/logger {:mvn/version "0.4.0"}
Require:
(ns my.namespace
(:require [ndevreeze.logger :as log]))
Initialise the logger:
(log/init "/tmp/foo.log" :info)
or, to only log to stderr:
(log/init nil :debug)
or, init with a map, with these keys:
if all of file, pattern and location are nil, do not create a logfile, just log to the console.
To use in pattern:
Then log at different levels:
(log/error "A different logfile, error level")
(log/warn "warn level")
(log/debug "One line at debug level")
(log/info "At info level")
$ lein midje
or:
$ lein repl (or start in Cider)
(use 'midje.repl)
(autotest)
See codox generated API docs. And cljdoc too: https://cljdoc.org/d/ndevreeze/logger/0.4.0/doc/readme
Copyright © 2020, 2021 Nico de Vreeze
Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close