airframe-log for Scala 3 (Dotty)

Taro L. Saito
Airframe
Published in
2 min readDec 11, 2020
Photo by Aaron Burden on Unsplash

Airframe Log, a modern logging library for Scala, now supports Scala 3.0.0-M2 (Dotty) since version 20.12.1, released on December 2020.

The usage is quite simple: Add LogSupport trait to your class and use error/warn/info/debug/trace methods for showing logs of your applications:

Now your application can show colorful logs, enriched with the source code location:

airframe-log uses Scala macros to reduce the overhead of generating log messages if the corresponding log level is not enabled. The biggest challenge in supporting Scala 3 was adopting the brand-new Scala Macro for Scala 3 while maintaining compatibilities with Scala 2.13 and Scala 2.12. To do so, we split the source code for Scala 2 and 3. The transition from Scala 2 to 3 may take several years until various libraries that are using Scala 2 macros or runtime-reflections will be fully migrated to Scala 3. Now, airframe-log has joined the list of libraries supporting Scala 3!

We still have many modules that need to be migrated to Scala 3, but now that tooling like sbt 1.4.x, vscode, and IntelliJ gradually have started supporting Scala 3 builds, it would be good timing to try and learn new exciting features of Scala 3!

--

--

Taro L. Saito
Airframe

Ph.D., researcher and software engineer, pursuing database technologies for everyone http://xerial.org/leo