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) }
- Alphabetic
- By Inheritance
- ZTestLogger
- ZLogger
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
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
-
abstract
def
logOutput: UIO[Chunk[LogEntry]]
Returns the contents of the log.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++[M <: Message, O](that: ZLogger[M, O])(implicit zippable: Zippable[Output, O]): ZLogger[M, Out]
- Definition Classes
- ZLogger
-
def
+>[M <: Message, O](that: ZLogger[M, O]): ZLogger[M, O]
- Definition Classes
- ZLogger
-
def
<+[M <: Message](that: ZLogger[M, Any]): ZLogger[M, Output]
- Definition Classes
- ZLogger
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
contramap[Message1](f: (Message1) ⇒ Message): ZLogger[Message1, Output]
- Definition Classes
- ZLogger
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
filterLogLevel(f: (LogLevel) ⇒ Boolean): ZLogger[Message, Option[Output]]
- Definition Classes
- ZLogger
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- 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
map[B](f: (Output) ⇒ B): ZLogger[Message, B]
- Definition Classes
- ZLogger
-
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
-
final
def
test(input: ⇒ Message): Output
- Definition Classes
- ZLogger
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()