Class LogCapture.Event

java.lang.Object
io.github.flink.gcp.connector.testutils.LogCapture.Event
Enclosing class:
LogCapture

public static final class LogCapture.Event extends Object
One collected log event, flattened out of log4j2's own type.

The level is carried for toString() — which is what an AssertJ failure prints — and is deliberately not exposed as a typed accessor. Doing so would mean mapping log4j2's levels onto a fixed set, and they are an open set: FATAL, plus whatever Level.forName(name, intValue) registers, at any severity. A mapping that missed one would throw inside append, which AbstractAppender is built to ignore, so the event would vanish — the one outcome this class exists to rule out. Holding the name verbatim cannot fail, and the capture's own threshold already answers the only question a caller has asked so far, which is which levels are collected at all.

  • Method Details

    • getMessage

      public String getMessage()
    • getThrowable

      public Throwable getThrowable()
      The throwable the statement passed, or null if it passed none.
    • toString

      public String toString()
      Overrides:
      toString in class Object