forked from fzakaria/slf4j-timbre
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fzakaria#54, fzakaria#45: Update to work with SLF4j 2.x, timbre 6.x
Replaces the SLF4J 1.7.x Binders with an SLF4J 2.x ServiceProvider. Works in example ("integration-test").
- Loading branch information
Dr. Christian Betz
committed
Jan 9, 2023
1 parent
9f1d565
commit 66689b4
Showing
10 changed files
with
128 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
(defproject example "1.0.0" | ||
:dependencies [[org.clojure/clojure "1.11.1"] | ||
[com.taoensso/timbre "5.2.1"] | ||
[org.slf4j/slf4j-api "1.7.36"] | ||
:dependencies [[org.clojure/clojure "1.11.1"] | ||
[com.taoensso/timbre "6.0.4"] | ||
[org.slf4j/slf4j-api "2.0.6"] | ||
; slf4j-timbre will be added here by lein update-in | ||
] | ||
:main example.core | ||
:aot [example.core]) | ||
:main example.core | ||
:aot [example.core]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
com.github.fzakaria.slf4j.timbre.TimbreServiceProvider |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
(ns slf4j-timbre.timbre-service-provider | ||
(:import (com.github.fzakaria.slf4j.timbre TimbreLoggerFactory) | ||
(org.slf4j ILoggerFactory IMarkerFactory) | ||
(org.slf4j.helpers BasicMDCAdapter BasicMarkerFactory) | ||
(org.slf4j.spi MDCAdapter)) | ||
(:gen-class :name com.github.fzakaria.slf4j.timbre.TimbreServiceProvider | ||
:implements [org.slf4j.spi.SLF4JServiceProvider] | ||
#_#_:methods [[getLoggerFactory [] org.slf4j.ILoggerFactory] | ||
[getMarkerFactory [] org.slf4j.IMarkerFactory] | ||
[getMDCAdapter [] org.slf4j.spi.MDCAdapter] | ||
[getRequestedApiVersion [] String] | ||
[initialize [] void]] | ||
) | ||
) | ||
|
||
|
||
(def ^:private logger-factory | ||
(TimbreLoggerFactory.)) | ||
|
||
(def ^:private marker-factory | ||
(BasicMarkerFactory.)) | ||
|
||
(def ^:private mdc-adapter | ||
(BasicMDCAdapter.)) | ||
|
||
|
||
(defn -initialize [_] | ||
[[]]) | ||
|
||
(defn -getLoggerFactory [_] | ||
logger-factory) | ||
|
||
(defn -getMarkerFactory [_] | ||
marker-factory) | ||
|
||
(defn -getMDCAdapter [_] | ||
mdc-adapter) | ||
|
||
(defn -getRequestedApiVersion [_] | ||
"2.0.99") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters