-
Notifications
You must be signed in to change notification settings - Fork 11
scala 3 support #5
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
Conversation
jvz
left a comment
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.
Looks good so far! Let me know when you're finished and we can work on making a release.
|
Thanks for the comments @jvz - I've only covered a fraction of the functions so far - I'll keep tipping away but it could take a while. Scala macros are not something I've worked with much. The tests also rely on scala reflection code that does not seem to work in Scala 3 so I might need to rewrite those too. |
|
@jvz I'm wondering about some logger methods and why we don't just call the delegate directly - that using the macro code doesn't seem to add anything in some cases. For example: this could be: |
|
Made some minor dependency updates recently. Go ahead and rebase or merge from master. |
|
@jvz I've made some progress but could you look at my comment from 10 days ago? Is it ok just to delegate the traceEntry and traceExit calls to wrapped logger instead of getting macros involved? In my head, the only benefit of the macros is to take Scala interpolated strings and convert them to log4j interpolated strings. |
|
Oh yeah, please, go ahead and make that a delegated method. The point of the macros in the past were to allow for string interpolation to be elided when logging is disabled for that call. |
|
@jvz is it ok to change the scala 2 build so that traceEntry and traceExit use no macros there either (for consistency)? |
|
Yes |
|
@jvz could you review this when you get a chance? |
jvz
left a comment
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.
This looks great! I like the simplifications you've done, too. Nice to see an easier macro-like system in Scala 3, too. Were there any other changes you think we need, or is this sufficient to work on a new release candidate?
|
@jvz I'm happy to get this merged as is |
|
Thanks so much for the PR! I'll work on a release candidate sometime today (assuming the rest of the build still works as documented). |
This is far from a full solution to having Scala 3 build working. It does upgrade some tools and libs as a baby step.
Relates to https://issues.apache.org/jira/browse/LOG4J2-3184
Biggest problem for scala 3 is writing something to replace https://github.com/apache/logging-log4j-scala/blob/master/src/main/scala-2.11%2B/org/apache/logging/log4j/scala/LoggerMacro.scala - this type of macro is not supported in scala 3 - the good news is that scala-logging have https://github.com/lightbend/scala-logging/blob/main/src/main/scala-3/com/typesafe/scalalogging/LoggerMacro.scala that could be the way to go