scala-logging
scala-logging copied to clipboard
[Demonstration Only] Cross-Version Support for Scala 2 and Scala 3
This is a proof of concept set of changes that demonstrates how to modify the scala-logging code to support projects that compile to both Scala 2 and Scala 3 at the same time. I do not want these changes (in their current form) to be merged into the scala-logging repo; in fact, I've rather gutted the project in order to make things work (for example, I had to remove LoggerTakingImplicits because cross-version macros didn't play nicely with implicits, and I dropped all of the scala-logging publishing stuff from the build since I didn't need it to build a local version that my project could depend on).
I was able to create a working cross-version solution that enables a project to migrate from Scala 2 to Scala 3 without being forced to do it all at once. I intend this code to serve as an example for anyone else who has the same need. This kind of solution should only ever be used on a temporary basis; after a project fully migrates to Scala 3, the public versions of the scala-logging library will be perfectly suitable for them again.
The solution to this cross-version problem was heavily inspired by the example mixed macros repo referenced in #317. There may be another solution that is not as destructive to the scala-logging library that could actually be merged into the repo, but I am not aware of what it would be.
Hi @srollins-lucid,
Thank you for your contribution! We really value the time you've taken to put this together.
Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: