https://github.com/kennyjwilli/logger
Data-first logging for Clojure
https://github.com/kennyjwilli/logger
clojure logging slf4j-api
Last synced: 3 months ago
JSON representation
Data-first logging for Clojure
- Host: GitHub
- URL: https://github.com/kennyjwilli/logger
- Owner: kennyjwilli
- License: mit
- Created: 2023-08-25T00:45:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-25T01:20:38.000Z (over 1 year ago)
- Last Synced: 2025-01-08T23:51:45.588Z (4 months ago)
- Topics: clojure, logging, slf4j-api
- Language: Clojure
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logger
A data-first logging approach.
## Installation
```clojure
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.```clojure
(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](https://www.slf4j.org/manual.html#fluent).## License
Copyright © 2023 Kenny Williams
Distributed under the MIT license. See the LICENSE file for more info.