Class LoggingTestKit$


  • public class LoggingTestKit$
    extends java.lang.Object
    Facilities for selectively matching log messages.

    Requires Logback.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static LoggingTestKit$ MODULE$
      Static reference to the singleton instance of this Scala object.
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggingTestKit$()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      LoggingTestKit custom​(scala.Function1<LoggingEvent,​java.lang.Object> test)
      Create a custom event filter.
      LoggingTestKit deadLetters()
      Filter for the logging of dead letters.
      LoggingTestKit debug​(java.lang.String messageIncludes)
      Create a filter for DEBUG level events with a log message that contains the given messageIncludes.
      LoggingTestKit empty()
      An empty filter that doesn't match any events.
      LoggingTestKit error​(java.lang.Class<? extends java.lang.Throwable> causeClass)
      Create a filter for ERROR level events with a an included throwable that is a class or subclass of the given * Throwable class.
      LoggingTestKit error​(java.lang.String messageIncludes)
      Create a filter for ERROR level events with a log message that contains the given messageIncludes.
      LoggingTestKit info​(java.lang.String messageIncludes)
      Create a filter for INFO level events with a log message that contains the given messageIncludes.
      LoggingTestKit messageContains​(java.lang.String str)
      Create a filter for events with a log message that contains the given messageIncludes.
      LoggingTestKit trace​(java.lang.String messageIncludes)
      Create a filter for TRACE level events with a log message that contains the given messageIncludes.
      LoggingTestKit warn​(java.lang.Class<java.lang.Throwable> causeClass)
      Create a filter for WARN level events with a an included throwable that is a class or subclass of the given * Throwable class.
      LoggingTestKit warn​(java.lang.String messageIncludes)
      Create a filter for WARN level events with a log message that contains the given messageIncludes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MODULE$

        public static final LoggingTestKit$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • LoggingTestKit$

        public LoggingTestKit$()
    • Method Detail

      • empty

        public LoggingTestKit empty()
        An empty filter that doesn't match any events.

        More conditions can be added to the returned [LoggingEventFilter].

        Returns:
        (undocumented)
      • messageContains

        public LoggingTestKit messageContains​(java.lang.String str)
        Create a filter for events with a log message that contains the given messageIncludes.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        str - (undocumented)
        Returns:
        (undocumented)
      • trace

        public LoggingTestKit trace​(java.lang.String messageIncludes)
        Create a filter for TRACE level events with a log message that contains the given messageIncludes.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        messageIncludes - (undocumented)
        Returns:
        (undocumented)
      • debug

        public LoggingTestKit debug​(java.lang.String messageIncludes)
        Create a filter for DEBUG level events with a log message that contains the given messageIncludes.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        messageIncludes - (undocumented)
        Returns:
        (undocumented)
      • info

        public LoggingTestKit info​(java.lang.String messageIncludes)
        Create a filter for INFO level events with a log message that contains the given messageIncludes.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        messageIncludes - (undocumented)
        Returns:
        (undocumented)
      • warn

        public LoggingTestKit warn​(java.lang.String messageIncludes)
        Create a filter for WARN level events with a log message that contains the given messageIncludes.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        messageIncludes - (undocumented)
        Returns:
        (undocumented)
      • warn

        public LoggingTestKit warn​(java.lang.Class<java.lang.Throwable> causeClass)
        Create a filter for WARN level events with a an included throwable that is a class or subclass of the given * Throwable class.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        causeClass - (undocumented)
        Returns:
        (undocumented)
      • error

        public LoggingTestKit error​(java.lang.String messageIncludes)
        Create a filter for ERROR level events with a log message that contains the given messageIncludes.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        messageIncludes - (undocumented)
        Returns:
        (undocumented)
      • error

        public LoggingTestKit error​(java.lang.Class<? extends java.lang.Throwable> causeClass)
        Create a filter for ERROR level events with a an included throwable that is a class or subclass of the given * Throwable class.

        More conditions can be added to the returned [LoggingEventFilter].

        Parameters:
        causeClass - (undocumented)
        Returns:
        (undocumented)
      • custom

        public LoggingTestKit custom​(scala.Function1<LoggingEvent,​java.lang.Object> test)
        Create a custom event filter. The filter will match those events for which for which the supplied function returns true.
        Parameters:
        test - (undocumented)
        Returns:
        (undocumented)
      • deadLetters

        public LoggingTestKit deadLetters()
        Filter for the logging of dead letters.
        Returns:
        (undocumented)