Trait/Object

zio.test

ZTestLogger

Related Docs: object ZTestLogger | package test

Permalink

sealed trait ZTestLogger[-Message, +Output] extends ZLogger[Message, Output]

A ZTestLogger is an implementation of a ZLogger that writes all log messages to an internal data structure. The contents of this data structure can be accessed using the logOutput operator. This makes it easy to write tests to verify that expected messages are being logged.

test("logging works") {
  for {
    _      <- ZIO.logDebug("It's alive!")
    output <- ZTestLogger.logOutput
  } yield assertTrue(output.length == 1) &&
    assertTrue(output(0).message() == "It's alive!") &&
    assertTrue(output(0).logLevel == LogLevel.Debug)
}
Linear Supertypes
ZLogger[Message, Output], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ZTestLogger
  2. ZLogger
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def apply(trace: Trace, fiberId: FiberId, logLevel: LogLevel, message: () ⇒ Message, cause: Cause[Any], context: FiberRefs, spans: List[LogSpan], annotations: Map[String, String]): Output

    Permalink
    Definition Classes
    ZLogger
  2. abstract def logOutput: UIO[Chunk[LogEntry]]

    Permalink

    Returns the contents of the log.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++[M <: Message, O](that: ZLogger[M, O])(implicit zippable: Zippable[Output, O]): ZLogger[M, Out]

    Permalink
    Definition Classes
    ZLogger
  4. def +>[M <: Message, O](that: ZLogger[M, O]): ZLogger[M, O]

    Permalink
    Definition Classes
    ZLogger
  5. def <+[M <: Message](that: ZLogger[M, Any]): ZLogger[M, Output]

    Permalink
    Definition Classes
    ZLogger
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def contramap[Message1](f: (Message1) ⇒ Message): ZLogger[Message1, Output]

    Permalink
    Definition Classes
    ZLogger
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def filterLogLevel(f: (LogLevel) ⇒ Boolean): ZLogger[Message, Option[Output]]

    Permalink
    Definition Classes
    ZLogger
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def map[B](f: (Output) ⇒ B): ZLogger[Message, B]

    Permalink
    Definition Classes
    ZLogger
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. final def test(input: ⇒ Message): Output

    Permalink
    Definition Classes
    ZLogger
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ZLogger[Message, Output]

Inherited from AnyRef

Inherited from Any

Ungrouped