zio-logging
zio-logging copied to clipboard
naming clash
More of an annoyance than anything else.
zio has a LogAnnotation class as well, in the zio package which is generally imported with a wildcard.
import zio.*
import zio.logging.*
val customLogAnnotation = LogAnnotation[Int]("custom_annotation", _ + _, _.toString)
results in
[error] 43 | LogAnnotation[Int](
[error] | ^^^^^^^^^^^^^
[error] | Reference to LogAnnotation is ambiguous,
[error] | it is both imported by import zio._
[error] | and imported subsequently by import zio.logging._
https://scastie.scala-lang.org/I2ab3bjGQZ64KZi1YJnfmA
perhaps the next major release could consider renaming LogAnnotation to avoid this
As we move to scala 3, the use of export statements is probably going to lead to users to generally expecting one import statement per library. clashes are inevitable, but for a library specifically designed to work with zio, and with a relatively small surface area, I think it's reasonable to avoid this.