You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Flowdalic (via GitHub)" <gi...@apache.org> on 2023/09/13 07:46:16 UTC

[GitHub] [logging-log4j-scala] Flowdalic opened a new pull request, #26: Fix Scala 3 Macros

Flowdalic opened a new pull request, #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26

   The charSequenceExprToStringExpr() caused (some?) strings to be evaluated to
   
   '{ ... }
   
   It turns out, the whole function is not neccessary: every invokation of ${charSequenceExprToStringExpr(message)} can be replaced with ${message.toString}, which evaluates to the desired String (e.g., "{} failed because of {} (baz={})").
   
   Furthermore, the return type of deconstructInterpolatedMessage() can be changed from Expr[String] to Expr[CharSequence]. This allows deconstructInterpolatedMessage() to drop its usage of charSequenceExprToStringExpr().
   
   With that change, I get proper log messages in my Scala


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] pjfanning commented on pull request #26: Fix Scala 3 Macros

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1740848723

   > @pjfanning, I understand the reaction and apologies for the wait. I am trying to overhaul the project. I will really appreciate it if you can submit the test you shared in a separate PR.
   
   Could you provide build instructions? I tried maven build with Java 11 and fails saying I need Java 17. Tried Java 17 and it fails saying I need Java 8.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] pjfanning commented on pull request #26: Fix Scala 3 Macros

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1719004954

   I have no status in the Apache Log4j project so I can't say if anyone from that team will merge this. It's over 3 years since the last release and in a recent email thread, I suggested my preference is to abandon this project. 
   
   https://lists.apache.org/thread/wtjmrq94ql2vkovq16tpolcfnzd45qbp
   
   The change looks potentially useful but it would be better if there was a unit test added that demos that this works. It might be better to wait to see if any Apache Log4j team member is willing to merge this and do releases before spending time improving this PR. If you do want to proceed, I would suggest a test that does something like this (in pseudocode):
   
   ```
   var logCount: Int = 0
   
   def incrementAndGetLogCount(): Int = {
     logCount += 1
     logCount
   }
   
   // in a test
   logger.debug(s"logCount = ${incrementAndGetLogCount()}")
   assert that logCount equals 0
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] vy commented on pull request #26: Fix Scala 3 Macros

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1740805536

   @Flowdalic, thanks so much for the fix and apologies for the late response. I have incorporated your fix in 66ac4a718112e536a1f293bfcd5a244d1ff9e410. I would really appreciate it if you can double check it. For the record, the project went through a major facelift operation. A sanity check from an experienced Scala developer will be great.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] vy commented on pull request #26: Fix Scala 3 Macros

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1740806588

   @pjfanning, I understand the reaction and apologies for the wait. I am trying to overhaul the project. I will really appreciate it if you can submit the test you shared in a separate PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] pjfanning commented on pull request #26: Fix Scala 3 Macros

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1718972037

   You are better off using Scala 3.3.x at runtime. This is the first set of LTS Scala 3 releases.
   
   The Scala Center have been actively encouraging lib maintainers to upgrade to Scala 3.3 even though it means the lib will no longer support Scala 3.0 - 3.2 at runtime.
   
   If you use other Scala libs than the log4j-api-scala then you will hit similar issues with many of those libs.
   
   And for the record, log4j-api-scala has never had its Scala 3 support appear in a release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] pjfanning commented on pull request #26: Fix Scala 3 Macros

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1740875481

   I got the maven build to work using Java 17 and setting a [toolchains.xml](https://maven.apache.org/guides/mini/guide-using-toolchains.html) that had a link to a Java 8 install.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] vy closed pull request #26: Fix Scala 3 Macros

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy closed pull request #26: Fix Scala 3 Macros
URL: https://github.com/apache/logging-log4j-scala/pull/26


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j-scala] vy commented on pull request #26: Fix Scala 3 Macros

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on PR #26:
URL: https://github.com/apache/logging-log4j-scala/pull/26#issuecomment-1740881559

   @pjfanning See the build instructions in `src/site/index.adoc`. (Sorry, the website is not up-to-date yet. I will do a release in a day or two.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org