-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slf4j bridge #202
Slf4j bridge #202
Conversation
Thanks @vigoo for this PR it looks pretty good. |
def attachRuntime(runtime: zio.Runtime[Logging]): Unit = | ||
this.runtime = runtime | ||
|
||
private[impl] def run[A](f: ZIO[Logging, Nothing, A]): Unit = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete the A
type parameter and accept ZIO[Logging, Nothing, Any]
, instead. Clearer expression of the same idea.
} | ||
|
||
object ZioLoggerFactory { | ||
def bind(runtime: zio.Runtime[Logging]): Unit = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialize
?
This PR adds a new module called
zio-logging-slf4j-bridge
, which is the "opposite" of the existing SLF4j support, registeringzio-logging
as an SLF4j provider.With this third party libraries logging through SLF4j can log through zio-logging without the need to a third party slf4j implementation.
This is good for reducing dependencies and simplify the whole logging stack of services.
For example we are using this for mixing in sttp and Netty logs to the zio-logging log stream of a service.
Easy filtering configuration makes this much more usable, a proposed solution for that is coming in another PR.