object LogZIO
- Alphabetic
- By Inheritance
- LogZIO
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addFiberIdToLogger[G[_], R, E, A](logger: AbstractLoggerF[G])(f: (Self) => ZIO[R, E, A]): ZIO[R, E, A]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withCustomContext[R, E, A](context: CustomContext)(thunk: ZIO[R, E, A])(implicit arg0: Tag[R]): ZIO[R with LogZIO, E, A]
Allows to provide logging context which will be passed through the given effect via ZIO environment.
Allows to provide logging context which will be passed through the given effect via ZIO environment.
import izumi.logstage.api.Log.CustomContext import logstage.LogZIO import logstage.LogZIO.log import zio.ZIO def databaseCall(): ZIO[LogZIO, Throwable, String] = ZIO.succeed("stubbed") def dbLayerFunction(arg: Int): ZIO[LogZIO, Throwable, String] = { LogZIO.withCustomContext(CustomContext("arg" -> arg)) { for { result <- databaseCall _ <- log.info(s"Database call $result") // … arg=1 Database call result=stubbed } yield result } }
- R
environment of the provided effect
- E
effect error type
- A
effect return type
- context
context to be provided
- thunk
the effect for which context will be passed
- returns
effect with the passed context
- def withCustomContext[R, E, A](context: (String, AnyEncoded)*)(thunk: ZIO[R, E, A])(implicit arg0: Tag[R]): ZIO[R with LogZIO, E, A]
Allows to provide logging context which will be passed through the given effect via ZIO environment.
Allows to provide logging context which will be passed through the given effect via ZIO environment.
import logstage.LogZIO import logstage.LogZIO.log import zio.ZIO def databaseCall(): ZIO[LogZIO, Throwable, String] = ZIO.succeed("stubbed") def dbLayerFunction(arg: Int): ZIO[LogZIO, Throwable, String] = { LogZIO.withCustomContext("arg" -> arg) { for { result <- databaseCall _ <- log.info(s"Database call $result") // … arg=1 Database call result=stubbed } yield result } }
- R
environment of the provided effect
- E
effect error type
- A
effect return type
- context
context to be provided
- thunk
the effect for which context will be passed
- returns
effect with the passed context
- def withDynamicContext[R](logger: AbstractLoggerF[[γ$11$]ZIO[R, Nothing, γ$11$]])(dynamic: ZIO[R, Nothing, CustomContext]): LogIO2[[β$12$, γ$13$]ZIO[R, β$12$, γ$13$]]
- def withDynamicContext[R](logger: AbstractLogger)(dynamic: ZIO[R, Nothing, CustomContext]): LogIO2[[β$3$, γ$4$]ZIO[R, β$3$, γ$4$]]
- def withFiberId(logger: AbstractLoggerF[[β$8$]ZIO[Any, Nothing, β$8$]]): LogIO2[IO]
- def withFiberId(logger: AbstractLogger): LogIO2[IO]
- object log extends LogZIOImpl
Lets you carry LogZIO capability in environment
Lets you carry LogZIO capability in environment
import logstage.LogZIO import logstage.LogZIO.log import zio.URIO def fn: URIO[LogZIO, Unit] = { log.info(s"I'm logging with ${log}stage!") }