Interface FixtureLogger

  • All Known Subinterfaces:
    AggregatingFixtureLogger
    All Known Implementing Classes:
    DefaultFixtureLogger

    public interface FixtureLogger
    The fixture logger should be used by fixture classes and methods in order to log stuff that does NOT originate from within the application under test itself, but from within the fixture logic.

    Fixture log output is collected separately from the applications' log output (from the console), which allows to get both log streams displayed in a separated fashion in the test result.

    Author:
    Rene Schneider - initial API and implementation
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void debug​(java.lang.String aMessage, java.lang.Object... someParameters)
      Log the specified message at FixtureLogLevel.DEBUG level.
      void error​(java.lang.String aMessage, java.lang.Object... someParameters)
      Log the specified message at FixtureLogLevel.ERROR level.
      void info​(java.lang.String aMessage, java.lang.Object... someParameters)
      Log the specified message at FixtureLogLevel.INFO level.
      void log​(FixtureLogLevel aLevel, java.lang.String aMessage, java.lang.Object... someParameters)
      Log the specified message at the specified log level.
      void trace​(java.lang.String aMessage, java.lang.Object... someParameters)
      Log the specified message at FixtureLogLevel.TRACE level.
      void warn​(java.lang.String aMessage, java.lang.Object... someParameters)
      Log the specified message at FixtureLogLevel.WARNING level.
    • Method Detail

      • log

        void log​(FixtureLogLevel aLevel,
                 java.lang.String aMessage,
                 java.lang.Object... someParameters)
        Log the specified message at the specified log level. The message may contain placeholders "{}" which will be replaced by the respective parameter provided (order of parameters is mapped onto order of placeholders). Non-String parameters are converted to Strings by calling toString().

        An exception is the last parameter: if it is a Throwable, it is not considered to be a "normal" parameter for a placeholder. Instead, the stacktrace of the Throwable is logged as part of the log message.

        Parameters:
        aLevel - the log level
        aMessage - the message to log (possibly with placeholders)
        someParameters - parameters to insert into placeholders, optionally a Throwable at the end of the list
      • error

        void error​(java.lang.String aMessage,
                   java.lang.Object... someParameters)
        Log the specified message at FixtureLogLevel.ERROR level. The message may contain placeholders "{}" which will be replaced by the respective parameter provided (order of parameters is mapped onto order of placeholders). Non-String parameters are converted to Strings by calling toString().

        An exception is the last parameter: if it is a Throwable, it is not considered to be a "normal" parameter for a placeholder. Instead, the stacktrace of the Throwable is logged as part of the log message.

        Parameters:
        aMessage - the message to log (possibly with placeholders)
        someParameters - parameters to insert into placeholders, optionally a Throwable at the end of the list
      • warn

        void warn​(java.lang.String aMessage,
                  java.lang.Object... someParameters)
        Log the specified message at FixtureLogLevel.WARNING level. The message may contain placeholders "{}" which will be replaced by the respective parameter provided (order of parameters is mapped onto order of placeholders). Non-String parameters are converted to Strings by calling toString().

        An exception is the last parameter: if it is a Throwable, it is not considered to be a "normal" parameter for a placeholder. Instead, the stacktrace of the Throwable is logged as part of the log message.

        Parameters:
        aMessage - the message to log (possibly with placeholders)
        someParameters - parameters to insert into placeholders, optionally a Throwable at the end of the list
      • info

        void info​(java.lang.String aMessage,
                  java.lang.Object... someParameters)
        Log the specified message at FixtureLogLevel.INFO level. The message may contain placeholders "{}" which will be replaced by the respective parameter provided (order of parameters is mapped onto order of placeholders). Non-String parameters are converted to Strings by calling toString().

        An exception is the last parameter: if it is a Throwable, it is not considered to be a "normal" parameter for a placeholder. Instead, the stacktrace of the Throwable is logged as part of the log message.

        Parameters:
        aMessage - the message to log (possibly with placeholders)
        someParameters - parameters to insert into placeholders, optionally a Throwable at the end of the list
      • debug

        void debug​(java.lang.String aMessage,
                   java.lang.Object... someParameters)
        Log the specified message at FixtureLogLevel.DEBUG level. The message may contain placeholders "{}" which will be replaced by the respective parameter provided (order of parameters is mapped onto order of placeholders). Non-String parameters are converted to Strings by calling toString().

        An exception is the last parameter: if it is a Throwable, it is not considered to be a "normal" parameter for a placeholder. Instead, the stacktrace of the Throwable is logged as part of the log message.

        Parameters:
        aMessage - the message to log (possibly with placeholders)
        someParameters - parameters to insert into placeholders, optionally a Throwable at the end of the list
      • trace

        void trace​(java.lang.String aMessage,
                   java.lang.Object... someParameters)
        Log the specified message at FixtureLogLevel.TRACE level. The message may contain placeholders "{}" which will be replaced by the respective parameter provided (order of parameters is mapped onto order of placeholders). Non-String parameters are converted to Strings by calling toString().

        An exception is the last parameter: if it is a Throwable, it is not considered to be a "normal" parameter for a placeholder. Instead, the stacktrace of the Throwable is logged as part of the log message.

        Parameters:
        aMessage - the message to log (possibly with placeholders)
        someParameters - parameters to insert into placeholders, optionally a Throwable at the end of the list