Skip to content

Commit 0ae875a

Browse files
committed
Close #441 - Add MdcAdapter for Cats Effect 3 to properly share context through MDC with IO and IOLocal from Cats Effect 3
1 parent 4f3d1c2 commit 0ae875a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/logger-f-logback-mdc-cats-effect3/shared/src/test/scala/loggerf/logger/logback/Ce3MdcAdapterSpec.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ import scala.jdk.CollectionConverters._
1414
* @since 2023-07-07
1515
*/
1616
object Ce3MdcAdapterSpec extends Properties {
17+
println(s"cats.effect.ioLocalPropagation=${sys.props.getOrElse("cats.effect.ioLocalPropagation", "")}")
18+
sys.props.put("cats.effect.ioLocalPropagation", "true")
19+
println(s"cats.effect.ioLocalPropagation=${sys.props.getOrElse("cats.effect.ioLocalPropagation", "")}")
1720

1821
implicit val ioRuntime: IORuntime = cats.effect.unsafe.implicits.global
1922

modules/logger-f-logback-mdc-cats-effect3/shared/src/test/scala/loggerf/logger/logback/Ce3MdcAdapterSpec2.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import scala.jdk.CollectionConverters._
1515
* @since 2023-07-07
1616
*/
1717
object Ce3MdcAdapterSpec2 extends Properties {
18+
println(s"cats.effect.ioLocalPropagation=${sys.props.getOrElse("cats.effect.ioLocalPropagation", "")}")
19+
sys.props.put("cats.effect.ioLocalPropagation", "true")
20+
println(s"cats.effect.ioLocalPropagation=${sys.props.getOrElse("cats.effect.ioLocalPropagation", "")}")
1821

1922
implicit val ioRuntime: IORuntime = cats.effect.unsafe.implicits.global
2023

0 commit comments

Comments
 (0)