-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Logback backend for kotlin-logging #452
Conversation
Right now it fails on formatting, see how to fix spotless here: https://github.com/oshai/kotlin-logging/blob/master/CONTRIBUTING.md In addition, since I want it to be both extended (with |
Thanks for the feedback! I'll get back to this next week. |
I've now fixed formatting issues and introduced |
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.
lgtm, left some comments.
@@ -4,4 +4,13 @@ public class KLoggingEventBuilder { | |||
public var message: String? = null | |||
public var cause: Throwable? = null | |||
public var payload: Map<String, Any?>? = null | |||
public var internalCompilerData: InternalCompilerData? = null |
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.
please document that this field is internal and should not be set
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.
Added JavaDoc
internal fun jLogger(name: String): Logger = | ||
logbackServiceProvider.loggerFactory.getLogger(name) as Logger | ||
|
||
/** wrap java logger based on location awareness */ |
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.
actually here there is no difference in location awerness so this can be removed
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.
Removed. And renamed methods and fields a bit.
src/jvmMain/kotlin/io/github/oshai/kotlinlogging/logback/internal/LogbackLogEvent.kt
Show resolved
Hide resolved
Can you please fix spotless again before I submit it? |
Fixed. I would like to also include a test that would execute I tried to play around with Gradle build file but my knowledge about Kotlin multiplatform (and Gradle) build system is limited -- maybe you can help out here? |
Thanks! I merged the PR and just now see this message. I think it will be difficult to do tests with / without logback in classpath. I also don't think gradle is very good at this. I think we can go without such test. |
Just to be sure, I ran a manual test with a simple project on my machine -- seems to work just fine (using Thanks! |
Proposal for #449
I'm not sure if this change requires kotlin-logging to always have Logback on runtime classpath or not (how eager is JVM classloading nowadays?) -- but we can figure that detail out later.