[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16535861#comment-16535861 ] ASF subversion and git services commented on LOG4J2-1705: - Commit 3b4e5d5c32179e22f8b892d571aa230734d886c0 in logging-log4j-kotlin's branch refs/heads/master from [~jvz] [ https://git-wip-us.apache.org/repos/asf?p=logging-log4j-kotlin.git;h=3b4e5d5 ] Add LOG4J2-1705 changelog entry > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API, Kotlin API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477677#comment-16477677 ] Matt Sicker commented on LOG4J2-1705: - Regarding the readme, I'll try to merge that over the next day or two. As for the site, we need that to have a place to even provide download links and such to the release. It could be worth bringing up a question regarding how to configure it on the mailing list. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16476537#comment-16476537 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] I have no idea how to generate the site for the Apache infrastructure. Is there someone else that can help? Should the vote thread be dependent on this -- perhaps we can get the appropriate help from the devs on the list? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16448302#comment-16448302 ] Matt Sicker commented on LOG4J2-1705: - I'm always posting on the dev list ;) I'll start the vote thread once we can successfully build the site and I can put together a release candidate from it. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16448288#comment-16448288 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] README pull request created. I have no idea why the site generation is not working. I've signed up on the dev mailing list. Will you be posting there, or shall I? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436406#comment-16436406 ] Matt Sicker commented on LOG4J2-1705: - The site doesn't seem to build anything. Not sure what's wrong there. Other than that, I think we're ready to begin the release process over on the mailing list where it'd be great to have your feedback as well. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436202#comment-16436202 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] I see you merged in the docs changes I made, great! What are the next steps? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16423331#comment-16423331 ] Raman Gupta commented on LOG4J2-1705: - [~jvz], I created starting point docs based on the Scala docs you pointed to. Here is the pull request: https://github.com/apache/logging-log4j-kotlin/pull/1 > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16422582#comment-16422582 ] Matt Sicker commented on LOG4J2-1705: - Of course! I've been trying AsciiDoc with the Scala site in [my branch|https://github.com/apache/logging-log4j-scala/tree/sbt], so that might be a place to start (though you'll need a maven asciidoc plugin of course). Another option would be using the maven-site-plugin that we use for the log4j site, but I've found that difficult to merge multiple physically separated projects together (see for example the current CSS problems with the existing Log4j Scala API site). > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16422528#comment-16422528 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] Can I help with that? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16417947#comment-16417947 ] Matt Sicker commented on LOG4J2-1705: - Next steps would be creating a site that will live at /log4j/kotlin/ similar to the Scala one, though it doesn't necessarily need to use maven-site-plugin if you know of something easier to use. As for publishing to Maven Central and such, that will require a release on our part, and I'd like to get the website and docs ready before we go forward with that. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16417789#comment-16417789 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] What are the next steps? Should this get added to the main log4j2 site and manual @ http://logging.apache.org/log4j/2.x/? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16416198#comment-16416198 ] Matt Sicker commented on LOG4J2-1705: - Yes, I noticed you were already using the right artifact ids on closer inspection. I was confused with the parent pom which I renamed. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16416190#comment-16416190 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] thanks, not sure if you noticed but the last few commits did include the updates you requested... see below for comments: > I'd suggest having integration tests using a {{ListAppender}}. Ok, done, check out LoggerCompanionTest, LoggerMixinCompanionExtendsTest, and LoggerMixinExtendsTest. I've also filled out the LoggerTest a little bit. > Yes, you can go ahead and delete {{KotlinCompleteLogger}}. Done! > The nullable type in the generic thing is something I missed and is pretty >neat! It is, isn't it? It's stuff like this that makes me realize Kotlin is *really* well thought out. > The API artifact id should be {{log4j-api-kotlin}} to match the existing >naming scheme. -It is already isn't it? The parent is log4j-kotlin, but the API artifact is log4j-api-kotlin. The group id is already org.apache.logging.log4j also.- Never mind, I see the changes you made on the (now) upstream repo. > Being a Kotlin project, would it make more sense to use gitbox (GitHub) >instead of the traditional git.apache.org+Jira workflow? This works for me. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Assignee: Matt Sicker >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415947#comment-16415947 ] Matt Sicker commented on LOG4J2-1705: - I'm going to work on merging this today actually. I'll create new issues for what's remaining before we can release. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16414542#comment-16414542 ] Matt Sicker commented on LOG4J2-1705: - Hey, sorry for not getting back sooner. Anyways, I have some more feedback and questions. * I'd suggest having integration tests using a {{ListAppender}}. That's a common pattern throughout Log4j, and I see you already used {{LoggerContextRule}} elsewhere. * Yes, you can go ahead and delete {{KotlinCompleteLogger}}. * The nullable type in the generic thing is something I missed and is pretty neat! * We can fix the FQCN API issue by excluding those particular methods from the public API for now and fixing it with a later Log4j release. As for some bookkeeping tasks to get this integrated as an official subproject: * The API artifact id should be {{log4j-api-kotlin}} to match the existing naming scheme. * The group id should be changed to {{org.apache.logging.log4j}} as well. * We'll be using the pre-made repo [here|https://github.com/apache/logging-log4j-kotlin] to merge into. * Being a Kotlin project, would it make more sense to use gitbox (GitHub) instead of the traditional git.apache.org+Jira workflow? I think that would help reduce friction in community contributions. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16404860#comment-16404860 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] [~rem...@yahoo.com] Just following up on this... any time to spend on a review so we can move this forward? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383257#comment-16383257 ] Raman Gupta commented on LOG4J2-1705: - I didn't see [~rem...@yahoo.com]'s message until just now... for the Kotlin API I would prefer non-nullable `Marker` as per [~jvz]'s initial comments. In my experience, marker's tend to be relatively simple, usually constant, values. If the marker is instead the result of calculations, then the user is already implementing extra logic anyway. In that case, Kotlin's elvis operator makes it easy to add a fallback marker value. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383191#comment-16383191 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] Mostly good points. Another iteration pushed. Some questions and comments: * I haven't touched `CompleteKotlinLogger` yet, as we may end up deleting this anyway (I think we should, as the user can always get the ExtendedLogger delegate from `KotlinLogger` anyway). * For `fun traceExit(message: CharSequence, result: R?): R?`, my approach allows for the return type to be non-null if the parameter is non-null whereas your signature always returns a nullable even if the parameter passed in is non-nullable. However, see comment below about trace methods. * Right now, args that take a `Supplier` are defined as `() -> Any?` – it's unclear to me what happens when you return a null value out of a supplier – if log4j skips the logging entirely, allowing the Supplier to return null might be a useful capability – the user can use it like an implicit `if(...) \{ log(...) }`. If that isn't a thing in the underlying implementation, then it should probably return `Any` instead. * I've left Throwable? – the methods that don't take a Throwable just delegate to passing `null: Throwable?` anyway, so that can be a useful shortcut if the user has a `Throwable?` value. * For traceEntry and traceExit, I had a TODO in there to clean these up and now I've done so. I'd like users to just use `runInTrace` which is far simpler and handles all of the conditions for them. That means I deleted all the `traceExit` methods entirely, and pared down `traceEntry` to (what I think) is the minimal needed to get an `EntryMessage`. Unfortunately, `ExtendedLogger` does not currently have any traceEntry methods that take a lambda for the message, so I had to create a lambda-accepting method that checks `isTraceEnabled` before calling the lambda. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383121#comment-16383121 ] Matt Sicker commented on LOG4J2-1705: - That's a good point. What about the other parameter types? I tend to avoid using null where possible, but I may not be typical. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383109#comment-16383109 ] Remko Popma commented on LOG4J2-1705: - Not sure if I agree with that last point on nullable markers. The marker may be the result of some calculations and may be null in the user code. Preventing nulls in the invocation means the conditional needs to live in user code instead of the library. Allowing nulls may make the library slightly friendlier to use. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16382910#comment-16382910 ] Matt Sicker commented on LOG4J2-1705: - Very nice! Some additional feedback so far: * At one point, we decided it would be nicer to support logging CharSequence explicitly instead of String. This allows for some fun use cases like shared, reusable buffers, and other high performance programming patterns. In general, just taking an Object (or an Any in this case) and switching on types is one approach, though using static dispatch here makes more sense when possible. With that in mind, you can remove the foo(String) methods that already have a corresponding foo(CharSequence) version. * traceEntry still has a vararg thing; I believe this can still use interpolated strings? * traceExit might make more sense as {{fun traceExit(message: CharSequence, result: R?): R?}} ** Or is your {{fun }} thing do the same thing essentially? ** Similarly, I'm not so sure about making messages nullable. We've had API compatibility issues in the past due to allowing nulls in parameters (see the 2.6.x API breakage historically). The params to a message can be nullable, but the message generally shouldn't be. That may not always be true, but in a new API, we can enforce that. * In general, most of these parameters should not be nullable (particularly markers). If a user goes through the trouble to use a function that takes a marker, they shouldn't be passing null; they can just use the other function with less parameters! > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16382898#comment-16382898 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] master now defaults to a `KotlinLogger` without the parameterized methods, as they are unnecessary in Kotlin. I've renamed and kept the old version around as `CompleteKotlinLogger`, at least for now. The latter implements the `Logger` interface, the former does not. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16379553#comment-16379553 ] Raman Gupta commented on LOG4J2-1705: - LOG4J2-2275 created to cover the API issue. > experimenting with a stand alone Logger class specific to Kotlin Sounds good. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16379113#comment-16379113 ] Matt Sicker commented on LOG4J2-1705: - A new issue would be great. Make sure to mention this issue there. As for a more thorough code review, I have time this week here and there to go through it in more detail. In the meantime, the only thing I can suggest is perhaps experimenting with a stand alone Logger class specific to Kotlin. See for example the Logger class in log4j-api-scala which doesn't include the parameterized logging parameters for example because Scala supports template strings (similar to Kotlin). As it is now, a Kotlin user can just create a Logger with the Java API along with some annoyances that you seem to have covered in the Kotlin extension. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378996#comment-16378996 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] We need a method similar to `logIfEnabled` for trace `entry` and `exit` on the `ExtendedLogger` interface. Should we create another issue for this? A review of the Kotlin module less this issue would be useful. Let me know next steps. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378661#comment-16378661 ] Matt Sicker commented on LOG4J2-1705: - If changes are needed to AbstractLogger or ExtendedLogger, we could get that integrated into the log4j-api module. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378160#comment-16378160 ] Raman Gupta commented on LOG4J2-1705: - [~garydgregory] [~jvz] Updated master to include location-aware logging, now that I understand how it works. It makes the FunctionalLogger far more verbose as Kotlin class delegates can't be used to make the calls to the wrapped ExtendedLogger automatically (AFAIK), passing the FQCN to `logIfEnabled`. In fact, the whole class should probably be renamed now to `KotlinLogger` as it is no longer specific to just adding functional methods on top of the automatic delegates. I don't see any other good way to do this though. Also note: unfortunately, location-aware logging still does not work for the traceEnter/traceExit calls, because the underlying methods that take the FQCN are not part of the ExtendedLogger interface, and they are protected in AbstractLogger, and cannot therefore be called from my wrapper. I'm not sure how other wrappers are handling this issue -- doesn't seem like there is a clean way short of reflection. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16370764#comment-16370764 ] Raman Gupta commented on LOG4J2-1705: - [~jvz] Thanks for the feedback. This is relatively trivial to do, and the companion unwrap code already exists. Support for interface-based mixin (at both top level and companion object) has been added in https://github.com/rocketraman/logging-log4j-kotlin/commit/2c353e8dc03986ffe820dda1d95038562f7e0e0d. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16370636#comment-16370636 ] Matt Sicker commented on LOG4J2-1705: - Coincidentally, I had to learn Kotlin for a gig I just had starting last December, so nowadays I'm a bit more comfortable with the language and can provide feedback. One thing I'd suggest based on a different Kotlin logging framework I tried out is perhaps offering a way to inject the logger into the companion object. For example: {code} class Foo { companion object : Logging fun foo() { logger.info("Hello, $world") } } {code} > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16370136#comment-16370136 ] Raman Gupta commented on LOG4J2-1705: - [~garydgregory] [~jvz] Any interesting in moving forward with this? > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta >Priority: Major > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (LOG4J2-1705) Kotlin wrapper for Log4j 2 API
[ https://issues.apache.org/jira/browse/LOG4J2-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16264865#comment-16264865 ] Raman Gupta commented on LOG4J2-1705: - [~garydgregory] [~jvz] I've updated my repo at https://github.com/rocketraman/logging-log4j-kotlin. Its in pretty decent shape now I think, except location-aware logging line numbers are totally messed up. I believe this is currently a limitation of `inline` functions in Kotlin -- there currently doesn't seem to be a way to get location info for Kotlin inline functions without inspecting the stack, however this is a very slow operation. I think we should consider publishing the module as-is, with the known limitation that location info works at the file level, but not at the line level. > Kotlin wrapper for Log4j 2 API > -- > > Key: LOG4J2-1705 > URL: https://issues.apache.org/jira/browse/LOG4J2-1705 > Project: Log4j 2 > Issue Type: New Feature > Components: API >Reporter: Raman Gupta > > Similar to LOG4J2-1181 for Scala, provide a Kotlin wrapper for the Log4j 2 > API that makes use of Kotlin features like delegates and string interpolation. > If there is interest in this, I'd like to contribute a patch. -- This message was sent by Atlassian JIRA (v6.4.14#64029)