diff --git a/core/js/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala b/core/js/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala index 097fc20..c9ccb89 100644 --- a/core/js/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala +++ b/core/js/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala @@ -2,7 +2,6 @@ package com.dwolla.consul.examples import cats.effect._ import natchez.Span -import natchez.mtl.natchezMtlTraceForLocal import natchez.noop.NoopEntrypoint import org.typelevel.log4cats.LoggerFactory import org.typelevel.log4cats.noop.NoOpFactory diff --git a/core/jvm/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala b/core/jvm/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala index 1831b64..69a2f1f 100644 --- a/core/jvm/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala +++ b/core/jvm/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgAppPlatform.scala @@ -1,11 +1,10 @@ package com.dwolla.consul.examples -import cats.effect.{Trace => _, _} +import cats.effect._ import cats.syntax.all._ import io.jaegertracing.Configuration._ import natchez._ import natchez.jaeger._ -import natchez.mtl.natchezMtlTraceForLocal import org.typelevel.log4cats.LoggerFactory import org.typelevel.log4cats.slf4j.Slf4jFactory diff --git a/core/shared/src/main/scala/com/dwolla/consul/ConsulServiceDiscoveryAlg.scala b/core/shared/src/main/scala/com/dwolla/consul/ConsulServiceDiscoveryAlg.scala index 936413e..b0275d9 100644 --- a/core/shared/src/main/scala/com/dwolla/consul/ConsulServiceDiscoveryAlg.scala +++ b/core/shared/src/main/scala/com/dwolla/consul/ConsulServiceDiscoveryAlg.scala @@ -11,7 +11,7 @@ import cats.{Applicative, Monad, ~>} import com.dwolla.consul.ThirdPartyTypeCodecs._ import fs2.Stream import io.circe._ -import natchez.noop.NoopTrace +import natchez.mtl.natchezMtlTraceForLocal import natchez.{EntryPoint, Span, Trace} import org.http4s.Method.GET import org.http4s._ @@ -65,11 +65,11 @@ object ConsulServiceDiscoveryAlg { * @tparam F the effect in which to operate * @return a new instance of `ConsulServiceDiscoveryAlg[F]` */ - def apply[F[_] : Temporal : LoggerFactory : Random : Trace](consulBaseUri: Uri, - longPollTimeout: FiniteDuration, - client: Client[F], - entryPoint: EntryPoint[F]) - (implicit L: Local[F, Span[F]]): F[ConsulServiceDiscoveryAlg[F]] = + def apply[F[_] : Temporal : LoggerFactory : Random](consulBaseUri: Uri, + longPollTimeout: FiniteDuration, + client: Client[F], + entryPoint: EntryPoint[F]) + (implicit L: Local[F, Span[F]]): F[ConsulServiceDiscoveryAlg[F]] = make(consulBaseUri, longPollTimeout, client, entryPoint.some) /** @@ -83,17 +83,17 @@ object ConsulServiceDiscoveryAlg { * @tparam F the effect in which to operate * @return a new instance of `ConsulServiceDiscoveryAlg[F]` */ - def apply[F[_] : Temporal : LoggerFactory : Random : Trace](consulBaseUri: Uri, - longPollTimeout: FiniteDuration, - client: Client[F]) - (implicit L: Local[F, Span[F]]): F[ConsulServiceDiscoveryAlg[F]] = + def apply[F[_] : Temporal : LoggerFactory : Random](consulBaseUri: Uri, + longPollTimeout: FiniteDuration, + client: Client[F]) + (implicit L: Local[F, Span[F]]): F[ConsulServiceDiscoveryAlg[F]] = make(consulBaseUri, longPollTimeout, client, None) - private def make[F[_] : Temporal : LoggerFactory : Random : Trace](consulBaseUri: Uri, - longPollTimeout: FiniteDuration, - client: Client[F], - entryPoint: Option[EntryPoint[F]]) - (implicit L: Local[F, Span[F]]): F[ConsulServiceDiscoveryAlg[F]] = + private def make[F[_] : Temporal : LoggerFactory : Random](consulBaseUri: Uri, + longPollTimeout: FiniteDuration, + client: Client[F], + entryPoint: Option[EntryPoint[F]]) + (implicit L: Local[F, Span[F]]): F[ConsulServiceDiscoveryAlg[F]] = LoggerFactory[F] .create(LoggerName("com.dwolla.consul.ConsulServiceDiscoveryAlg")) .map { implicit l => @@ -249,7 +249,7 @@ object ConsulServiceDiscoveryAlg { F: Temporal[F], L: LoggerFactory[F], R: Random[F]): F[ConsulServiceDiscoveryAlg[F]] = - apply(consulBaseUri, longPollTimeout, client)(F, L, R, NoopTrace()(F), new BrokenIllegalNoopLocalSpan(F)) + apply(consulBaseUri, longPollTimeout, client)(F, L, R, new BrokenIllegalNoopLocalSpan(F)) @deprecated("maintained for binary compatibility: this version doesn't place background traces in the proper scope", "0.3.1") def apply[F[_]](consulBaseUri: Uri, @@ -259,7 +259,7 @@ object ConsulServiceDiscoveryAlg { L: LoggerFactory[F], R: Random[F], T: Trace[F]): F[ConsulServiceDiscoveryAlg[F]] = - apply(consulBaseUri, longPollTimeout, client)(F, L, R, T, new BrokenIllegalNoopLocalSpan(F)) + apply(consulBaseUri, longPollTimeout, client)(F, L, R, new BrokenIllegalNoopLocalSpan(F)) private class BrokenIllegalNoopLocalSpan[F[_]](A: Applicative[F]) extends Local[F, Span[F]] { override def local[A](fa: F[A])(f: Span[F] => Span[F]): F[A] = fa diff --git a/core/shared/src/test/scala/com/dwolla/consul/ConsulServiceDiscoveryAlgSpec.scala b/core/shared/src/test/scala/com/dwolla/consul/ConsulServiceDiscoveryAlgSpec.scala index 15909e0..04a0935 100644 --- a/core/shared/src/test/scala/com/dwolla/consul/ConsulServiceDiscoveryAlgSpec.scala +++ b/core/shared/src/test/scala/com/dwolla/consul/ConsulServiceDiscoveryAlgSpec.scala @@ -13,7 +13,6 @@ import io.circe.literal._ import io.circe.syntax._ import munit.{CatsEffectSuite, ScalaCheckEffectSuite} import natchez.Span -import natchez.mtl.natchezMtlTraceForLocal import org.http4s.Uri.Host import org.http4s._ import org.http4s.circe._ diff --git a/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulMiddlewareApp.scala b/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulMiddlewareApp.scala index 651e75e..3c76db8 100644 --- a/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulMiddlewareApp.scala +++ b/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulMiddlewareApp.scala @@ -56,8 +56,8 @@ object ConsulMiddlewareApp extends ConsulMiddlewareAppPlatform { .parMapN(ConsulMiddleware(_)(_)) .flatten - private def consulServiceDiscoveryAlg[F[_] : Async : Random : LoggerFactory : Trace : Network](entryPoint: EntryPoint[F]) - (implicit L: Local[F, Span[F]]): Resource[F, ConsulServiceDiscoveryAlg[F]] = + private def consulServiceDiscoveryAlg[F[_] : Async : Random : LoggerFactory : Network](entryPoint: EntryPoint[F]) + (implicit L: Local[F, Span[F]]): Resource[F, ConsulServiceDiscoveryAlg[F]] = longPollClient[F].evalMap(ConsulServiceDiscoveryAlg(uri"http://localhost:8500", 1.minute, _, entryPoint)) private def longPollClient[F[_] : Async : Network]: Resource[F, Client[F]] = clientWithTimeout(75.seconds) diff --git a/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgApp.scala b/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgApp.scala index 41975d8..85e4952 100644 --- a/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgApp.scala +++ b/core/shared/src/test/scala/com/dwolla/consul/examples/ConsulServiceDiscoveryAlgApp.scala @@ -1,13 +1,13 @@ package com.dwolla.consul package examples -import cats.effect.{Trace => _, _} +import cats.effect._ import cats.effect.std.Random import cats.mtl.Local import cats.syntax.all._ import fs2.Stream import fs2.io.net.Network -import natchez.{EntryPoint, Span, Trace} +import natchez.{EntryPoint, Span} import org.http4s.client.dsl.Http4sClientDsl import org.http4s.ember.client.EmberClientBuilder import org.http4s.syntax.all._ @@ -15,8 +15,8 @@ import org.typelevel.log4cats.{Logger, LoggerFactory} import scala.concurrent.duration._ -class ConsulServiceDiscoveryAlgApp[F[_] : Async : LoggerFactory : Trace : Network](entryPoint: EntryPoint[F]) - (implicit L: Local[F, Span[F]]) extends Http4sClientDsl[F] { +class ConsulServiceDiscoveryAlgApp[F[_] : Async : LoggerFactory : Network](entryPoint: EntryPoint[F]) + (implicit L: Local[F, Span[F]]) extends Http4sClientDsl[F] { private implicit def loggerR(implicit L: Logger[F]): Logger[Resource[F, *]] = Logger[F].mapK(Resource.liftK) private val serviceName = ServiceName("httpd")