Packages

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. Protected

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
    Definition Classes
    ZLogger
  2. abstract def logOutput: UIO[Chunk[LogEntry]]

    Returns the contents of the log.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def ++[M <: Message, O](that: ZLogger[M, O])(implicit zippable: Zippable[Output, O]): ZLogger[M, Out]

    Combines this logger with the specified logger to produce a new logger that logs to both this logger and that logger.

    Combines this logger with the specified logger to produce a new logger that logs to both this logger and that logger.

    Definition Classes
    ZLogger
  4. def +>[M <: Message, O](that: ZLogger[M, O]): ZLogger[M, O]
    Definition Classes
    ZLogger
  5. def <+[M <: Message](that: ZLogger[M, Any]): ZLogger[M, Output]
    Definition Classes
    ZLogger
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  9. final def contramap[Message1](f: (Message1) => Message): ZLogger[Message1, Output]
    Definition Classes
    ZLogger
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. final def filterLogLevel(f: (LogLevel) => Boolean): ZLogger[Message, Option[Output]]

    Returns a version of this logger that only logs messages when the log level satisfies the specified predicate.

    Returns a version of this logger that only logs messages when the log level satisfies the specified predicate.

    Definition Classes
    ZLogger
  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def map[B](f: (Output) => B): ZLogger[Message, B]
    Definition Classes
    ZLogger
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. final def test(input: => Message): Output
    Definition Classes
    ZLogger
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from ZLogger[Message, Output]

Inherited from AnyRef

Inherited from Any

Ungrouped