de.caff.util.debug

## Class SimpleOutputtingDebugListener

- java.lang.Object
- - de.caff.util.debug.SimpleOutputtingDebugListener

- All Implemented Interfaces:
    AnyMessageDebugListener, AssertionMessageDebugListener, CookedMessageDebugListener, DebugConstants, ErrorMessageDebugListener, FatalMessageDebugListener, LogMessageListener, StandardMessageDebugListener, TraceMessageDebugListener, WarningMessageDebugListener

      public class SimpleOutputtingDebugListener
      extends java.lang.Object
      implements CookedMessageDebugListener, AnyMessageDebugListener

  A debug listener which copies all messages to a stream. It's useful for all categories of messages.
  Author:
    Rammi
  See Also:
    `Debug`

- - ### Field Summary

    - ### Fields inherited from interface de.caff.util.debug.DebugConstants

      `ASSERT, ASSERT_CHAR, ASSERT_FLAG, DEBUG_ALL_MASK, ERROR, ERROR_CHAR, ERROR_FLAG, FATAL, FATAL_CHAR, FATAL_FLAG, LOG, LOG_CHAR, LOG_FLAG, MESSAGE, MESSAGE_CHAR, MESSAGE_FLAG, NO_DEBUG_MASK, NR_DEBUG_TYPES, TRACE, TRACE_CHAR, TRACE_FLAG, WARNING, WARNING_CHAR, WARNING_FLAG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleOutputtingDebugListener(java.io.OutputStream stream)` Construct a new listener for the given stream.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `receiveCookedMessage(int msgType, java.lang.String msg, java.lang.String pos)` Receive a cooked message.
    `void` | `receiveErrorMessage(java.lang.String msg, java.lang.String pos)` Receive a raw error message.
    `boolean` | `receiveFailedAssertionMessage(java.lang.String msg, java.lang.String pos)` Receive a raw message about a failed assertion and return, whether an exception shall be thrown.
    `int` | `receiveFatalMessage(java.lang.String msg, java.lang.String pos)` Receive a raw fatal error message and return whether the program shall be exited.
    `void` | `receiveLogMessage(java.lang.String msg, java.lang.String pos)` Receive a raw logging debug message.
    `void` | `receiveStandardMessage(java.lang.String msg, java.lang.String pos)` Receive a raw standard debug message.
    `void` | `receiveTraceMessage(java.lang.String msg, java.lang.String pos)` Receive a raw trace debug message.
    `void` | `receiveWarningMessage(java.lang.String msg, java.lang.String pos)` Receive a raw warning debug message.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleOutputtingDebugListener

          public SimpleOutputtingDebugListener(java.io.OutputStream stream)

      Construct a new listener for the given stream.
      Parameters:
        `stream` - output stream

  - ### Method Detail

    - #### receiveTraceMessage

          public void receiveTraceMessage(@NotNull
                                          java.lang.String msg,
                                          @NotNull
                                          java.lang.String pos)

      Receive a raw trace debug message.
      Specified by:
        `receiveTraceMessage` in interface `TraceMessageDebugListener`
      Parameters:
        `msg` - the message
        `pos` - postion

    - #### receiveStandardMessage

          public void receiveStandardMessage(@NotNull
                                             java.lang.String msg,
                                             @NotNull
                                             java.lang.String pos)

      Receive a raw standard debug message.
      Specified by:
        `receiveStandardMessage` in interface `StandardMessageDebugListener`
      Parameters:
        `msg` - die Meldung
        `pos` - postion

    - #### receiveWarningMessage

          public void receiveWarningMessage(@NotNull
                                            java.lang.String msg,
                                            @NotNull
                                            java.lang.String pos)

      Receive a raw warning debug message.
      Specified by:
        `receiveWarningMessage` in interface `WarningMessageDebugListener`
      Parameters:
        `msg` - the message
        `pos` - postion

    - #### receiveErrorMessage

          public void receiveErrorMessage(@NotNull
                                          java.lang.String msg,
                                          @NotNull
                                          java.lang.String pos)

      Receive a raw error message.
      Specified by:
        `receiveErrorMessage` in interface `ErrorMessageDebugListener`
      Parameters:
        `msg` - the message
        `pos` - postion

    - #### receiveLogMessage

          public void receiveLogMessage(@NotNull
                                        java.lang.String msg,
                                        @NotNull
                                        java.lang.String pos)

      Receive a raw logging debug message.
      Specified by:
        `receiveLogMessage` in interface `LogMessageListener`
      Parameters:
        `msg` - the message
        `pos` - postion

    - #### receiveFatalMessage

          public int receiveFatalMessage(@NotNull
                                         java.lang.String msg,
                                         @NotNull
                                         java.lang.String pos)

      Receive a raw fatal error message and return whether the program shall be exited.
      Specified by:
        `receiveFatalMessage` in interface `FatalMessageDebugListener`
      Parameters:
        `msg` - the message
        `pos` - postion
      Returns:
        `1` -- exit the program

    - #### receiveFailedAssertionMessage

          public boolean receiveFailedAssertionMessage(@NotNull
                                                       java.lang.String msg,
                                                       @NotNull
                                                       java.lang.String pos)

      Receive a raw message about a failed assertion and return, whether an exception shall be thrown.
      Specified by:
        `receiveFailedAssertionMessage` in interface `AssertionMessageDebugListener`
      Parameters:
        `msg` - the message
        `pos` - postion
      Returns:
        `true` -- create exception

    - #### receiveCookedMessage

          public void receiveCookedMessage(int msgType,
                                           java.lang.String msg,
                                           java.lang.String pos)

      Receive a cooked message.
      Specified by:
        `receiveCookedMessage` in interface `CookedMessageDebugListener`
      Parameters:
        `msgType` - message type (ignored)
        `msg` - the message
        `pos` - postion