-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add direct log4cats
integration
#286
base: main
Are you sure you want to change the base?
Conversation
c507c12
to
1ccb243
Compare
log4cats
integrationlog4cats
integration
val callingMethodIndex = stacktraceElements.size - lastIndex | ||
val callingMethod = stacktraceElements(callingMethodIndex) | ||
val fileName = | ||
(callingMethod.getClassName.replace('.', '/') + ".scala").split("\\/").takeRight(1).mkString |
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.
On JS it returns something like (<jscode>.scala:96229)
, not sure how to get a source file / line number.
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.
log4cats
doesn't support sourcecode info, but it's a requirement for woof
.
Perhaps, I could create a variant of Logger#doLog
which doesn't require LogInfo
to facilitate log4cats
integration.
override def isErrorEnabled: F[Boolean] = Applicative[F].pure(true) | ||
override def isWarnEnabled: F[Boolean] = Applicative[F].pure(true) | ||
override def isInfoEnabled: F[Boolean] = Applicative[F].pure(true) | ||
override def isDebugEnabled: F[Boolean] = Applicative[F].pure(true) | ||
override def isTraceEnabled: F[Boolean] = Applicative[F].pure(true) |
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.
Not sure if it's a problem, but log level filtering works.
1ccb243
to
b39dfe2
Compare
b39dfe2
to
50265ab
Compare
Direct
log4cats
integration withoutslf4j
middleman.Allows using Woof with the new
http4s-1.x
as it requiresLoggerFactory[F]
forEmberClientBuilder
andEmberServerBuilder
.Works on JVM.
On JS test needs to be fixed - the
LogInfo
is a little wonky there.Couldn't run Native locally, apparently it hangs on linking.
Failed to run
mdoc
too.