Repository: 7mind/izumi
Pull request #1038 (2020-05-05 11:23:53)

Add StringRenderingPolicy constructors to RenderingPolicy companion object


Patch:
diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/DIResource.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/DIResource.scala
index 0fda11e31..062d2167b 100644
--- a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/DIResource.scala
+++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/DIResource.scala
@@ -493,11 +493,6 @@ object DIResource {
     final def wrapRelease[G[x] >: F[x]](f: (InnerResource => G[Unit], InnerResource) => G[Unit]): DIResourceBase[G, OuterResource] = wrapReleaseImpl[G, OuterResource](this: this.type)(f)
 
     final def void: DIResourceBase[F, Unit] = map(_ => ())
-
-    @deprecated("Use wrapAcquire", "will be removed in 0.10.3")
-    final def logAcquire[G[x] >: F[x]](f: (=> G[InnerResource]) => G[InnerResource]): DIResourceBase[G, OuterResource] = wrapAcquire(f)
-    @deprecated("Use wrapRelease", "will be removed in 0.10.3")
-    final def logRelease[G[x] >: F[x]](f: (InnerResource => G[Unit], InnerResource) => G[Unit]): DIResourceBase[G, OuterResource] = wrapRelease(f)
   }
 
   object DIResourceBase {
diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala
index b6767e81f..1b17f0d31 100644
--- a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala
+++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/AbstractBindingDefDSL.scala
@@ -99,7 +99,7 @@ trait AbstractBindingDefDSL[BindDSL[_], BindDSLAfterFrom[_], SetDSL[_]] {
 
   /** Same as `addImplicit[T].named(name)`
     * @deprecated Use `addImplicit[T].named(name)` instead, since 0.10.6 */
-  @deprecated("Use `addImplicit[T].named(name)` instead", "0.10.6")
+  @deprecated("Use `addImplicit[T].named(name)` instead", "will be removed in 0.10.8")
   final protected[this] def addImplicit[T: Tag](name: String)(implicit instance: T, pos: CodePositionMaterializer): Unit = {
     _registered(new SingletonRef(Bindings.binding(instance), mutable.Queue(SingletonInstruction.SetId(name, IdContract.stringIdContract)))).discard()
   }
diff --git a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala
index 08b60e0a2..d9dc636e4 100644
--- a/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala
+++ b/distage/distage-core-api/src/main/scala/izumi/distage/model/definition/dsl/ModuleDefDSL.scala
@@ -465,11 +465,12 @@ object ModuleDefDSL {
         * Warning: removes the precise subtype of DIResource because of `DIResource.map`:
         * Integration checks on DIResource will be lost
         */
-      final def fromHas[R1 <: DIResourceBase[Any, T]: AnyConstructor](implicit tag: TrifunctorHasResourceTag[R1, T]): AfterBind = {
+      def fromHas[R1 <: DIResourceBase[Any, T]: AnyConstructor](implicit tag: TrifunctorHasResourceTag[R1, T]): AfterBind = {
         import tag._
-        val provider: ProviderMagnet[DIResourceBase[F[Any, E, ?], A]] = AnyConstructor[R1].zip(HasConstructor[R]).map2(ProviderMagnet.identity[BIOLocal[F]](tagBIOLocal)) {
-          case ((resource, r), f) => provideDIResource(f)(resource, r)
-        }
+        val provider: ProviderMagnet[DIResourceBase[F[Any, E, ?], A]] =
+          AnyConstructor[R1].zip(HasConstructor[R]).map2(ProviderMagnet.identity[BIOLocal[F]](tagBIOLocal)) {
+            case ((resource, r), f) => provideDIResource(f)(resource, r)
+          }
         dsl.fromResource(provider)
       }
     }
diff --git a/distage/distage-extension-config/src/main/scala/izumi/distage/config/codec/DIConfigReader.scala b/distage/distage-extension-config/src/main/scala/izumi/distage/config/codec/DIConfigReader.scala
index 1195a0e26..8b5d190f9 100644
--- a/distage/distage-extension-config/src/main/scala/izumi/distage/config/codec/DIConfigReader.scala
+++ b/distage/distage-extension-config/src/main/scala/izumi/distage/config/codec/DIConfigReader.scala
@@ -91,9 +91,6 @@ object DIConfigReader extends LowPriorityDIConfigReaderInstances {
         case Right(value) => Success(value)
       }
   }
-
-  @deprecated("Use derived", "will be removed in 0.10.3")
-  def derive[T: ClassTag](implicit dec: PureconfigAutoDerive[T]): DIConfigReader[T] = derived[T]
 }
 
 sealed trait LowPriorityDIConfigReaderInstances {
diff --git a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOAsync3.scala b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOAsync3.scala
index 5a71d69e7..f7386b7fb 100644
--- a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOAsync3.scala
+++ b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOAsync3.scala
@@ -4,7 +4,8 @@ import java.util.concurrent.CompletionStage
 
 import scala.concurrent.{ExecutionContext, Future}
 
-trait BIOAsync3[F[-_, +_, +_]] extends BIO3[F] with BIOParallel[F] {
+trait BIOAsync3[F[-_, +_, +_]] extends BIO3[F] with BIOParallel3[F] {
+  override val InnerF: BIOMonad3[F] = this
   final type Canceler = F[Any, Nothing, Unit]
 
   def async[E, A](register: (Either[E, A] => Unit) => Unit): F[Any, E, A]
diff --git a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOCatsConversions.scala b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOCatsConversions.scala
index accec709b..e4a873583 100644
--- a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOCatsConversions.scala
+++ b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOCatsConversions.scala
@@ -6,6 +6,7 @@ import izumi.functional.bio.BIOCatsConversions._
 import izumi.functional.bio.SpecificityHelper.{S1, S10, S2, S3, S4, S5, S6, S7, S8, S9}
 
 import scala.util.Either
+import cats.~>
 
 /**
   * Automatic converters from BIO* hierarchy to equivalent cats & cats-effect classes.
@@ -55,7 +56,10 @@ trait BIOCatsConversions7 extends BIOCatsConversions8 {
 trait BIOCatsConversions8 extends BIOCatsConversions9 {
   @inline implicit final def BIOAsyncToAsync[F[+_, +_]](implicit F: BIOAsync[F]): cats.effect.Async[F[Throwable, ?]] with S9 = new BIOCatsAsync[F](F)
 }
-trait BIOCatsConversions9 {
+trait BIOCatsConversions9 extends BIOCatsConversions10 {
+  @inline implicit final def BIOParallelToParallel[F[+_, +_]](implicit F: BIOParallel[F]): cats.Parallel[F[Throwable, ?]] = new BIOCatsParallel[F](F)
+}
+trait BIOCatsConversions10 {
   @inline implicit final def BIOAsyncForkToConcurrent[F[+_, +_]](
     implicit @deprecated("unused", "") ev: BIOFunctor[F],
     F: BIOAsync[F],
@@ -143,10 +147,37 @@ object BIOCatsConversions {
   }
 
   class BIOCatsSync[F[+_, +_]](override val F: BIO[F]) extends BIOCatsBracket[F](F) with cats.effect.Sync[F[Throwable, ?]] {
+    self =>
     @inline override final def suspend[A](thunk: => F[Throwable, A]): F[Throwable, A] = F.flatten(F.syncThrowable(thunk))
     @inline override final def delay[A](thunk: => A): F[Throwable, A] = F.syncThrowable(thunk)
   }
 
+  class BIOCatsParallel[F0[+_, +_]](private val F0: BIOParallel[F0]) extends cats.Parallel[F0[Throwable, ?]] {
+    type M[A] = F0[Throwable, A]
+    override type F[A] = M[A]
+
+    @inline override final def sequential: F ~> M = cats.arrow.FunctionK.id[M]
+    @inline override final def parallel: M ~> F = cats.arrow.FunctionK.id[F]
+
+    override lazy val applicative: cats.Applicative[F] = new cats.Applicative[F] {
+      @inline override final def ap[A, B](ff: F[A => B])(fa: F[A]): F[B] = F0.zipWithPar(ff, fa)(_.apply(_))
+      @inline override final def pure[A](x: A): F[A] = F0.InnerF.pure(x)
+
+      @inline override final def product[A, B](fa: F[A], fb: F[B]): F[(A, B)] = F0.zipPar(fa, fb)
+      @inline override final def productL[A, B](fa: F[A])(fb: F[B]): F[A] = F0.zipParLeft(fa, fb)
+      @inline override final def productR[A, B](fa: F[A])(fb: F[B]): F[B] = F0.zipParRight(fa, fb)
+    }
+
+    override lazy val monad: cats.Monad[M] = new cats.Monad[M] {
+      @inline override final def pure[A](x: A): M[A] = F0.InnerF.pure(x)
+      @inline override final def flatMap[A, B](fa: M[A])(f: A => M[B]): M[B] = F0.InnerF.flatMap(fa)(f)
+      @inline override final def tailRecM[A, B](a: A)(f: A => M[Either[A, B]]): M[B] = F0.InnerF.flatMap(f(a)) {
+        case Left(next) => tailRecM(next)(f)
+        case Right(res) => F0.InnerF.pure(res)
+      }
+    }
+  }
+
   class BIOCatsAsync[F[+_, +_]](override val F: BIOAsync[F]) extends BIOCatsSync[F](F) with cats.effect.Async[F[Throwable, ?]] {
     @inline override final def async[A](k: (Either[Throwable, A] => Unit) => Unit): F[Throwable, A] = F.async(k)
     @inline override final def asyncF[A](k: (Either[Throwable, A] => Unit) => F[Throwable, Unit]): F[Throwable, A] = F.asyncF(k)
diff --git a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOExit.scala b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOExit.scala
index 1c91c5890..ba20e4317 100644
--- a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOExit.scala
+++ b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOExit.scala
@@ -21,8 +21,6 @@ object BIOExit {
   }
 
   object Trace {
-    @deprecated("Use ZIOTrace", "will be removed after 0.10.5")
-    private[bio] def zioTrace[E](cause: Cause[E]): Trace[E] = ZIOTrace(cause)
     def empty: Trace[Nothing] = new Trace[Nothing] {
       val asString: String = "<empty trace>"
       def toThrowable: Throwable = new RuntimeException(asString)
diff --git a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOParallel.scala b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOParallel3.scala
similarity index 95%
rename from fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOParallel.scala
rename to fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOParallel3.scala
index f9a237847..120c52cc7 100644
--- a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOParallel.scala
+++ b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIOParallel3.scala
@@ -1,7 +1,7 @@
 package izumi.functional.bio
 
-trait BIOParallel[F[-_, +_, +_]] extends BIORoot {
-  val InnerF: BIOFunctor3[F]
+trait BIOParallel3[F[-_, +_, +_]] extends BIORoot {
+  val InnerF: BIOMonad3[F]
 
   def parTraverseN[R, E, A, B](maxConcurrent: Int)(l: Iterable[A])(f: A => F[R, E, B]): F[R, E, List[B]]
   def parTraverse[R, E, A, B](l: Iterable[A])(f: A => F[R, E, B]): F[R, E, List[B]]
diff --git a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIORoot.scala b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIORoot.scala
index 9a92f34e2..975bf6352 100644
--- a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIORoot.scala
+++ b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/BIORoot.scala
@@ -34,23 +34,28 @@ sealed trait BIORootInstancesLowPriority1 extends BIORootInstancesLowPriority2 {
 }
 
 sealed trait BIORootInstancesLowPriority2 extends BIORootInstancesLowPriority3 {
-  @inline implicit final def BIOConvertFromBIOProfunctor[FR[-_, +_, +_]](implicit BIOProfunctor: NotPredefined.Of[BIOProfunctor[FR]]): BIOFunctor3[FR] with S3 = S3(BIOProfunctor.InnerF)
+  @inline implicit final def BIOConvertFromBIOParallel[FR[-_, +_, +_]](implicit BIOParallel: NotPredefined.Of[BIOParallel3[FR]]): BIOMonad3[FR] with S5 = S5(BIOParallel.InnerF)
 
   @inline implicit final def AttachBIOProfunctor[FR[-_, +_, +_]](@deprecated("unused", "") self: BIOFunctor3[FR])(implicit BIOProfunctor: BIOProfunctor[FR]): BIOProfunctor.type = BIOProfunctor
   @inline implicit final def AttachBIOAsk[FR[-_, +_, +_], R](@deprecated("unused", "") self: BIOFunctor3[FR])(implicit BIOAsk: BIOAsk[FR]): BIOAsk.type = BIOAsk
   @inline implicit final def AttachBIOBifunctor[FR[-_, +_, +_], R](@deprecated("unused", "") self: BIOFunctor3[FR])(implicit BIOBifunctor: BIOBifunctor3[FR]): BIOBifunctor.type = BIOBifunctor
+  @inline implicit final def AttachBIOParallel[FR[-_, +_, +_], R](@deprecated("unused", "") self: BIOMonad3[FR])(implicit BIOParallel: BIOParallel3[FR]): BIOParallel.type = BIOParallel
 }
 
 sealed trait BIORootInstancesLowPriority3 extends BIORootInstancesLowPriority4 {
-  @inline implicit final def BIOConvertFromBIOBifunctor[FR[-_, +_, +_]](implicit BIOBifunctor: NotPredefined.Of[BIOBifunctor3[FR]]): BIOFunctor3[FR] with S4 = S4(BIOBifunctor.InnerF)
+  @inline implicit final def BIOConvertFromBIOProfunctor[FR[-_, +_, +_]](implicit BIOProfunctor: NotPredefined.Of[BIOProfunctor[FR]]): BIOFunctor3[FR] with S3 = S3(BIOProfunctor.InnerF)
 }
 
 sealed trait BIORootInstancesLowPriority4 extends BIORootInstancesLowPriority5 {
+  @inline implicit final def BIOConvertFromBIOBifunctor[FR[-_, +_, +_]](implicit BIOBifunctor: NotPredefined.Of[BIOBifunctor3[FR]]): BIOFunctor3[FR] with S4 = S4(BIOBifunctor.InnerF)
+}
+
+sealed trait BIORootInstancesLowPriority5 extends BIORootInstancesLowPriority6 {
   // place ZIO instance at the root of the hierarchy, so that it's visible when summoning any class in hierarchy
   @inline implicit final def BIOZIO: Predefined.Of[BIOAsync3[ZIO] with BIOLocal[ZIO]] = Predefined(BIOAsyncZio)
 }
 
-sealed trait BIORootInstancesLowPriority5 {
+sealed trait BIORootInstancesLowPriority6 {
   @inline implicit final def BIOConvert3To2[C[_[-_, +_, +_]] <: DivergenceHelper, FR[-_, +_, +_], R0](
     implicit BIOFunctor3: C[FR] { type Divergence = Nondivergent }
   ): C[Lambda[(`-R`, `+E`, `+A`) => FR[R0, E, A]]] with DivergenceHelper { type Divergence = Divergent } =
diff --git a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/package.scala b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/package.scala
index f4fdd630f..e5fefd81a 100644
--- a/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/package.scala
+++ b/fundamentals/fundamentals-bio/src/main/scala/izumi/functional/bio/package.scala
@@ -71,6 +71,7 @@ package object bio extends BIO3Syntax with BIOSyntax {
   type BIOBracket[F[+_, +_]] = BIOBracket3[Lambda[(`-R`, `+E`, `+A`) => F[E, A]]]
   type BIOPanic[F[+_, +_]] = BIOPanic3[Lambda[(`-R`, `+E`, `+A`) => F[E, A]]]
   type BIO[F[+_, +_]] = BIO3[Lambda[(`-R`, `+E`, `+A`) => F[E, A]]]
+  type BIOParallel[F[+_, +_]] = BIOParallel3[Lambda[(`-R`, `+E`, `+A`) => F[E, A]]]
   type BIOAsync[F[+_, +_]] = BIOAsync3[Lambda[(`-R`, `+E`, `+A`) => F[E, A]]]
   type BIOTemporal[F[+_, +_]] = BIOTemporal3[Lambda[(`-R`, `+E`, `+A`) => F[E, A]]]
 
diff --git a/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerConfig.scala b/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerConfig.scala
new file mode 100644
index 000000000..dcc7d7d2b
--- /dev/null
+++ b/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerConfig.scala
@@ -0,0 +1,3 @@
+package izumi.logstage.api.config
+
+final case class LoggerConfig(root: LoggerPathConfig, entries: Map[String, LoggerPathConfig])
diff --git a/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerPathConfig.scala b/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerPathConfig.scala
index a03281ec8..93a0405d1 100644
--- a/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerPathConfig.scala
+++ b/logstage/logstage-core/src/main/scala/izumi/logstage/api/config/LoggerPathConfig.scala
@@ -4,5 +4,3 @@ import izumi.logstage.api.Log
 import izumi.logstage.api.logger.LogSink
 
 final case class LoggerPathConfig(threshold: Log.Level, sinks: Seq[LogSink])
-
-final case class LoggerConfig(root: LoggerPathConfig, entries: Map[String, LoggerPathConfig])
diff --git a/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/RenderingPolicy.scala b/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/RenderingPolicy.scala
index ff3d5032c..62f7e0528 100644
--- a/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/RenderingPolicy.scala
+++ b/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/RenderingPolicy.scala
@@ -1,7 +1,17 @@
 package izumi.logstage.api.rendering
 
 import izumi.logstage.api.Log
+import izumi.logstage.api.rendering.logunits.Renderer
 
 trait RenderingPolicy {
   def render(entry: Log.Entry): String
 }
+
+object RenderingPolicy {
+  def coloringPolicy(renderingLayout: Option[Renderer.Aggregate] = None): StringRenderingPolicy = {
+    new StringRenderingPolicy(RenderingOptions.default, renderingLayout)
+  }
+  def simplePolicy(renderingLayout: Option[Renderer.Aggregate] = None): StringRenderingPolicy = {
+    new StringRenderingPolicy(RenderingOptions.simple, renderingLayout)
+  }
+}
\ No newline at end of file
diff --git a/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/StringRenderingPolicy.scala b/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/StringRenderingPolicy.scala
index bf84456f3..7364720ea 100644
--- a/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/StringRenderingPolicy.scala
+++ b/logstage/logstage-core/src/main/scala/izumi/logstage/api/rendering/StringRenderingPolicy.scala
@@ -9,7 +9,10 @@ import izumi.logstage.api.rendering.logunits.Styler.{PadType, TrimType}
 import izumi.logstage.api.rendering.logunits.{Extractor, Renderer, Styler}
 import izumi.logstage.api.{Log, rendering}
 
-class StringRenderingPolicy(options: RenderingOptions, template: Option[Renderer.Aggregate] = None) extends RenderingPolicy {
+class StringRenderingPolicy(
+  options: RenderingOptions,
+  template: Option[Renderer.Aggregate] = None
+) extends RenderingPolicy {
   protected val context: RenderingOptions = {
     // it may be a good idea to remove these direct queries to the environment may
 
diff --git a/logstage/logstage-core/src/main/scala/izumi/logstage/api/routing/ConfigurableLogRouter.scala b/logstage/logstage-core/src/main/scala/izumi/logstage/api/routing/ConfigurableLogRouter.scala
index b0267213a..9e57404ba 100644
--- a/logstage/logstage-core/src/main/scala/izumi/logstage/api/routing/ConfigurableLogRouter.scala
+++ b/logstage/logstage-core/src/main/scala/izumi/logstage/api/routing/ConfigurableLogRouter.scala
@@ -9,8 +9,7 @@ import izumi.logstage.sink.{ConsoleSink, FallbackConsoleSink}
 
 import scala.util.control.NonFatal
 
-class ConfigurableLogRouter
-(
+class ConfigurableLogRouter(
   logConfigService: LogConfigService
 ) extends LogRouter {
   private final val fallback = TrivialLogger.make[FallbackConsoleSink](LogRouter.fallbackPropertyName, Config(forceLog = true))
diff --git a/logstage/logstage-core/src/main/scala/izumi/logstage/sink/ConsoleSink.scala b/logstage/logstage-core/src/main/scala/izumi/logstage/sink/ConsoleSink.scala
index 9b1da57d8..5dddfcd0d 100644
--- a/logstage/logstage-core/src/main/scala/izumi/logstage/sink/ConsoleSink.scala
+++ b/logstage/logstage-core/src/main/scala/izumi/logstage/sink/ConsoleSink.scala
@@ -13,13 +13,10 @@ class ConsoleSink(policy: RenderingPolicy) extends LogSink {
 
 object ConsoleSink {
   def apply(policy: RenderingPolicy): ConsoleSink = new ConsoleSink(policy)
+
   def text(colored: Boolean = true): ConsoleSink = if (colored) ColoredConsoleSink else SimpleConsoleSink
 
-  object ColoredConsoleSink extends ConsoleSink(coloringPolicy())
-  object SimpleConsoleSink extends ConsoleSink(simplePolicy())
+  object ColoredConsoleSink extends ConsoleSink(RenderingPolicy.coloringPolicy())
+  object SimpleConsoleSink extends ConsoleSink(RenderingPolicy.simplePolicy())
 
-  private[logstage] def coloringPolicy(renderingLayout: Option[Renderer.Aggregate] = None): StringRenderingPolicy =
-    new StringRenderingPolicy(RenderingOptions.default, renderingLayout)
-  private[logstage] def simplePolicy(renderingLayout: Option[Renderer.Aggregate] = None): StringRenderingPolicy =
-    new StringRenderingPolicy(RenderingOptions.simple, renderingLayout)
 }
diff --git a/logstage/logstage-sink-slf4j/src/main/scala/izumi/logstage/sink/slf4j/LogSinkLegacySlf4jImpl.scala b/logstage/logstage-sink-slf4j/src/main/scala/izumi/logstage/sink/slf4j/LogSinkLegacySlf4jImpl.scala
index b90d0e2a5..681036bd1 100644
--- a/logstage/logstage-sink-slf4j/src/main/scala/izumi/logstage/sink/slf4j/LogSinkLegacySlf4jImpl.scala
+++ b/logstage/logstage-sink-slf4j/src/main/scala/izumi/logstage/sink/slf4j/LogSinkLegacySlf4jImpl.scala
@@ -60,3 +60,7 @@ class LogSinkLegacySlf4jImpl
     loggers.computeIfAbsent(loggerId, (id: String) => slf4j.LoggerFactory.getLogger(id))
   }
 }
+
+object LogSinkLegacySlf4jImpl {
+  def apply(policy: RenderingPolicy): LogSinkLegacySlf4jImpl = new LogSinkLegacySlf4jImpl(policy)
+}
diff --git a/project/project/PluginVersions.scala b/project/project/PluginVersions.scala
index 3cf34334e..b14c25913 100644
--- a/project/project/PluginVersions.scala
+++ b/project/project/PluginVersions.scala
@@ -1,5 +1,5 @@
 object PV {
-  val sbt_mdoc = "2.1.5"
+  val sbt_mdoc = "2.2.0"
   val sbt_paradox_material_theme = "0.6.0"
   val sbt_ghpages = "0.6.3"
   val sbt_site = "1.3.3"


Test patch:
diff --git a/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala b/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala
deleted file mode 100644
index 7acbe70f3..000000000
--- a/distage/distage-testkit-core/src/main/scala/izumi/distage/testkit/services/DISyntaxZIOEnv.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-package izumi.distage.testkit.services
-
-@deprecated("Use DistageBIOEnvSpecScalatest", "will be removed in 0.10.3")
-trait DISyntaxZIOEnv
-@deprecated("Use DistageBIOEnvSpecScalatest", "will be removed in 0.10.3")
-object DISyntaxZIOEnv extends DISyntaxZIOEnv
diff --git a/fundamentals/fundamentals-bio/src/test/scala/izumi/fundamentals/bio/test/CatsConversionTest.scala b/fundamentals/fundamentals-bio/src/test/scala/izumi/fundamentals/bio/test/CatsConversionTest.scala
index 92a77c0c5..06484f977 100644
--- a/fundamentals/fundamentals-bio/src/test/scala/izumi/fundamentals/bio/test/CatsConversionTest.scala
+++ b/fundamentals/fundamentals-bio/src/test/scala/izumi/fundamentals/bio/test/CatsConversionTest.scala
@@ -5,6 +5,8 @@ import cats.effect.{Async, Concurrent, Sync}
 import izumi.functional.bio.{BIO, F}
 import izumi.functional.bio.catz._
 import org.scalatest.wordspec.AnyWordSpec
+import izumi.functional.bio.BIOAsync
+import cats.Parallel
 
 class CatsConversionTest extends AnyWordSpec {
 
@@ -18,6 +20,7 @@ class CatsConversionTest extends AnyWordSpec {
     conv[zio.IO]
     implicitly[Sync[zio.Task]]
     implicitly[Async[zio.Task]]
+    implicitly[Parallel[zio.Task]]
     implicitly[Concurrent[zio.Task]]
   }
 
@@ -40,5 +43,4 @@ class CatsConversionTest extends AnyWordSpec {
     c1[zio.IO]
     c2[zio.IO]
   }
-
 }
diff --git a/logstage/logstage-core/.jvm/src/test/scala/izumi/logstage/sink/LoggingFileSinkTest.scala b/logstage/logstage-core/.jvm/src/test/scala/izumi/logstage/sink/LoggingFileSinkTest.scala
index 12fa2f7af..948604cd2 100644
--- a/logstage/logstage-core/.jvm/src/test/scala/izumi/logstage/sink/LoggingFileSinkTest.scala
+++ b/logstage/logstage-core/.jvm/src/test/scala/izumi/logstage/sink/LoggingFileSinkTest.scala
@@ -46,7 +46,7 @@ trait LoggingFileSinkTest[T <: LogFile] extends AnyWordSpec with GivenWhenThen {
 
   "File sink" should {
 
-    val policy = ConsoleSink.simplePolicy()
+    val policy = RenderingPolicy.simplePolicy()
 
     val dummyFolder = "target/logstage"
 
diff --git a/logstage/logstage-core/src/test/scala/izumi/logstage/sink/LoggingConsoleSinkTest.scala b/logstage/logstage-core/src/test/scala/izumi/logstage/sink/LoggingConsoleSinkTest.scala
index 83e503fea..de3a27e81 100644
--- a/logstage/logstage-core/src/test/scala/izumi/logstage/sink/LoggingConsoleSinkTest.scala
+++ b/logstage/logstage-core/src/test/scala/izumi/logstage/sink/LoggingConsoleSinkTest.scala
@@ -1,6 +1,7 @@
 package izumi.logstage.sink
 
 import izumi.logstage.api.IzLogger
+import izumi.logstage.sink.ConsoleSink.ColoredConsoleSink
 import org.scalatest.wordspec.AnyWordSpec
 
 class LoggingConsoleSinkTest extends AnyWordSpec {
@@ -16,7 +17,7 @@ class LoggingConsoleSinkTest extends AnyWordSpec {
 object LoggingConsoleSinkTest {
 
   def setupConsoleLogger(): IzLogger = {
-    IzLogger(IzLogger.Level.Trace, new ConsoleSink(ConsoleSink.coloringPolicy()))
+    IzLogger(IzLogger.Level.Trace, ColoredConsoleSink)
   }
 
 }
diff --git a/logstage/logstage-sink-slf4j/src/test/scala/izumi/logstage/sink/slf4j/LoggingSlf4jSinkTest.scala b/logstage/logstage-sink-slf4j/src/test/scala/izumi/logstage/sink/slf4j/LoggingSlf4jSinkTest.scala
index d0107cd71..443429e1b 100644
--- a/logstage/logstage-sink-slf4j/src/test/scala/izumi/logstage/sink/slf4j/LoggingSlf4jSinkTest.scala
+++ b/logstage/logstage-sink-slf4j/src/test/scala/izumi/logstage/sink/slf4j/LoggingSlf4jSinkTest.scala
@@ -1,6 +1,7 @@
 package izumi.logstage.sink.slf4j
 
 import izumi.logstage.api.IzLogger
+import izumi.logstage.api.rendering.RenderingPolicy
 import izumi.logstage.sink.{ConsoleSink, ExampleService}
 import org.scalatest.wordspec.AnyWordSpec
 
@@ -16,8 +17,7 @@ class LoggingSlf4jSinkTest extends AnyWordSpec {
 }
 
 object LoggingSlf4jSinkTest {
-  val sinkLegacySlf4jImpl = new LogSinkLegacySlf4jImpl(ConsoleSink.simplePolicy())
-
+  val sinkLegacySlf4jImpl = LogSinkLegacySlf4jImpl(RenderingPolicy.simplePolicy())
 
   def setupSlf4jLogger(): IzLogger = {
     IzLogger(IzLogger.Level.Trace, sinkLegacySlf4jImpl)