diff --git a/build.sbt b/build.sbt index 7625e9e2..ec55ec79 100644 --- a/build.sbt +++ b/build.sbt @@ -212,7 +212,7 @@ lazy val lightstepGrpc = project libraryDependencies ++= Seq( "com.lightstep.tracer" % "tracer-grpc" % "0.30.3", "io.grpc" % "grpc-netty" % "1.37.0", - "io.netty" % "netty-tcnative-boringssl-static" % "2.0.38.Final" + "io.netty" % "netty-tcnative-boringssl-static" % "2.0.39.Final" ) ) @@ -266,13 +266,17 @@ lazy val log = crossProject(JSPlatform, JVMPlatform) .settings(commonSettings) .settings(crossProjectSettings) .settings( - publish / skip := scalaVersion.value.startsWith("3."), name := "natchez-log", description := "Logging bindings for Natchez, using log4cats.", libraryDependencies ++= Seq( - "io.circe" %%% "circe-core" % "0.13.0", - "io.chrisdavenport" %%% "log4cats-core" % "1.1.1", - ).filterNot(_ => scalaVersion.value.startsWith("3.")) + "io.circe" %%% "circe-core" % { + if (scalaVersion.value == scala30PreviousVersion) "0.14.0-M5" + else if (scalaVersion.value == scala30Version) "0.14.0-M6" + else "0.13.0" + }, + "org.typelevel" %%% "log4cats-core" % "1.3.0", + "io.github.cquiroz" %%% "scala-java-time" % "2.2.2" % Test, + ) ) lazy val logJVM = log.jvm.dependsOn(coreJVM) lazy val logJS = log.js.dependsOn(coreJS) diff --git a/modules/log/shared/src/main/scala-2/Log.scala b/modules/log/shared/src/main/scala/Log.scala similarity index 95% rename from modules/log/shared/src/main/scala-2/Log.scala rename to modules/log/shared/src/main/scala/Log.scala index 1686ca56..1b3eceea 100644 --- a/modules/log/shared/src/main/scala-2/Log.scala +++ b/modules/log/shared/src/main/scala/Log.scala @@ -7,7 +7,7 @@ package log import cats.effect.{ Resource, Sync } import cats.syntax.functor._ -import io.chrisdavenport.log4cats.Logger +import org.typelevel.log4cats.Logger import io.circe.Json object Log { diff --git a/modules/log/shared/src/main/scala-2/LogSpan.scala b/modules/log/shared/src/main/scala/LogSpan.scala similarity index 97% rename from modules/log/shared/src/main/scala-2/LogSpan.scala rename to modules/log/shared/src/main/scala/LogSpan.scala index 3b3948b2..e3f49652 100644 --- a/modules/log/shared/src/main/scala-2/LogSpan.scala +++ b/modules/log/shared/src/main/scala/LogSpan.scala @@ -16,7 +16,7 @@ import io.circe.Json import io.circe.Encoder import io.circe.syntax._ import io.circe.JsonObject -import io.chrisdavenport.log4cats.Logger +import org.typelevel.log4cats.Logger import java.net.URI private[log] final case class LogSpan[F[_]: Sync: Logger]( @@ -79,7 +79,7 @@ private[log] final case class LogSpan[F[_]: Sync: Logger]( exitCase match { case Completed => List("exit.case" -> "completed".asJson) case Canceled => List("exit.case" -> "canceled".asJson) - case Error(ex: Fields) => exitFields(ex) ++ ex.fields.toList.map(_.map(_.asJson)) + case Error(ex: Fields) => exitFields(ex) ++ ex.fields.toList.map { case (k, v) => (k, v.asJson) } case Error(ex) => exitFields(ex) } } ++ fs ++ List("children" -> cs.reverse.map(Json.fromJsonObject).asJson) @@ -91,8 +91,8 @@ private[log] final case class LogSpan[F[_]: Sync: Logger]( def traceId: F[Option[String]] = traceUUID.toString.some.pure[F] - def spanId: F[Option[String]] = - sid.toString.some.pure[F] + def spanId: F[Option[String]] = + sid.toString.some.pure[F] def traceUri: F[Option[URI]] = none.pure[F] } diff --git a/modules/log/jvm/src/test/scala-2/LogSuite.scala b/modules/log/shared/src/test/scala/LogSuite.scala similarity index 100% rename from modules/log/jvm/src/test/scala-2/LogSuite.scala rename to modules/log/shared/src/test/scala/LogSuite.scala diff --git a/modules/log/jvm/src/test/scala-2/MockLogger.scala b/modules/log/shared/src/test/scala/MockLogger.scala similarity index 97% rename from modules/log/jvm/src/test/scala-2/MockLogger.scala rename to modules/log/shared/src/test/scala/MockLogger.scala index 08021a27..189d7640 100644 --- a/modules/log/jvm/src/test/scala-2/MockLogger.scala +++ b/modules/log/shared/src/test/scala/MockLogger.scala @@ -5,7 +5,7 @@ package natchez package log -import io.chrisdavenport.log4cats.Logger +import org.typelevel.log4cats.Logger import cats.effect.Sync import cats.effect.concurrent.Ref import cats.syntax.all._