kennyjwilli / logger

Data-first logging for Clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logger

A data-first logging approach.

Installation

dev.kwill/logger {:mvn/version "1.0.1"}

Usage

To actually see log lines printed, you'll need to add a slf4j compatible logging implementation. e.g., Logback, log4j2, etc.

(require '[kwill.logger :as log])

(log/info {:msg "hello"})

(log/error {:msg "an error" :throwable (ex-info "oops" {:some "data"})})

All log functions accept a map of data to log. The only required key is :msg, specifying the log message. The :throwable key can be optionally included to specify a Throwable to log. All others keys are included as key-values in the log message using the new fluent API.

License

Copyright © 2023 Kenny Williams

Distributed under the MIT license. See the LICENSE file for more info.

About

Data-first logging for Clojure

License:MIT License


Languages

Language:Clojure 100.0%