Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/shared/src/main/scala/zio/ZIOAspect.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ object ZIOAspect {
zio.debug
}

/**
* An aspect that prints the results of an effect to the console for debugging
* purposes, using a specified user-defined prefix label.
*/
def debug(prefix: => String): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any] =
new ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any] {
override def apply[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A] =
zio.debug(prefix)
}

/**
* An aspect that logs values by using [[ZIO.log]].
*/
Expand Down