Skip to content

Instantly share code, notes, and snippets.

@searler
searler / CustomZLogger.scala
Created January 23, 2022 16:24
Adding custom ZLogger to capture unhandled defects
// https://github.com/zio/zio/issues/6278
import zio.{Cause, FiberId, FiberRef, LogLevel, LogSpan, RuntimeConfigAspect, ZIO, ZIOAppDefault, ZLogger, ZTraceElement}
object Example extends ZIOAppDefault {
val specialLogger: ZLogger[Cause[Any], Unit] =
(
trace: ZTraceElement,
fiberId: FiberId,