Package com.tibco.patterns.dedupe_utils

## Class PrintStreamLogger

- java.lang.Object
- - com.tibco.patterns.dedupe_utils.PrintStreamLogger

- All Implemented Interfaces:
    `Logger`

      public class PrintStreamLogger
      extends java.lang.Object
      implements Logger

  A simple implementation of the `Logger` interface that writes to a PrintStream.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PrintStreamLogger​(java.io.PrintStream stream)` | Constructs a PrintStreamLogger.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `debug​(java.lang.String message, java.lang.Throwable cause)` | Logs a debug message.
    `void` | `error​(java.lang.String message, java.lang.Throwable cause)` | Logs an error message.
    `void` | `fatal​(java.lang.String message, java.lang.Throwable cause)` | Logs a fatal message.
    `boolean` | `getDebugEnabled()` |
    `boolean` | `getInfoEnabled()` |
    `java.lang.String` | `getLeadFormat()` |
    `boolean` | `getTraceEnabled()` |
    `boolean` | `getWarnEnabled()` |
    `void` | `info​(java.lang.String message, java.lang.Throwable cause)` | Logs an informational message.
    `void` | `setDebugEnabled​(boolean enabled)` |
    `void` | `setInfoEnabled​(boolean enabled)` |
    `void` | `setLeadFormat​(java.lang.String lead_format)` | Set the format used for at the head of each log line.
    `void` | `setTraceEnabled​(boolean enabled)` |
    `void` | `setWarnEnabled​(boolean enabled)` |
    `void` | `trace​(java.lang.String message, java.lang.Throwable cause)` | Logs a trace message.
    `void` | `warn​(java.lang.String message, java.lang.Throwable cause)` | Logs a warning message.

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

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

- - ### Constructor Detail

    - #### PrintStreamLogger

          public PrintStreamLogger​(java.io.PrintStream stream)

      Constructs a PrintStreamLogger.
      Parameters:
        `stream` - The logger writes to this stream.

  - ### Method Detail

    - #### getDebugEnabled

          public boolean getDebugEnabled()

      Specified by:
        `getDebugEnabled` in interface `Logger`
      Returns:
        The debug flag, which controls whether debug messages are logged.

    - #### setDebugEnabled

          public void setDebugEnabled​(boolean enabled)

      Specified by:
        `setDebugEnabled` in interface `Logger`
      Parameters:
        `enabled` - The debug flag, which controls whether debug messages are logged.

    - #### getTraceEnabled

          public boolean getTraceEnabled()

      Specified by:
        `getTraceEnabled` in interface `Logger`
      Returns:
        The trace flag, which controls whether trace messages are logged.

    - #### setTraceEnabled

          public void setTraceEnabled​(boolean enabled)

      Specified by:
        `setTraceEnabled` in interface `Logger`
      Parameters:
        `enabled` - The trace flag, which controls whether trace messages are logged.

    - #### getInfoEnabled

          public boolean getInfoEnabled()

      Specified by:
        `getInfoEnabled` in interface `Logger`
      Returns:
        The info flag, which controls whether info messages are logged.

    - #### setInfoEnabled

          public void setInfoEnabled​(boolean enabled)

      Specified by:
        `setInfoEnabled` in interface `Logger`
      Parameters:
        `enabled` - The info flag, which controls whether info messages are logged.

    - #### getWarnEnabled

          public boolean getWarnEnabled()

      Specified by:
        `getWarnEnabled` in interface `Logger`
      Returns:
        The warn flag, which controls whether warn messages are logged.

    - #### setWarnEnabled

          public void setWarnEnabled​(boolean enabled)

      Specified by:
        `setWarnEnabled` in interface `Logger`
      Parameters:
        `enabled` - The warn flag, which controls whether warn messages are logged.

    - #### getLeadFormat

          public java.lang.String getLeadFormat()

      Returns:
        The format used for at the head of each log line.

    - #### setLeadFormat

          public void setLeadFormat​(java.lang.String lead_format)

      Set the format used for at the head of each log line.
      Parameters:
        `lead_format` - The format used for at the head of each log line.

    - #### trace

          public void trace​(java.lang.String message,
                            java.lang.Throwable cause)

      Description copied from interface: `Logger`
      Logs a trace message.

      Enabling tracing can result in a very large number of log messages, substantially slowing deduplication. It should only be enabled under the direction of your TIBO support representative.

      Specified by:
        `trace` in interface `Logger`
      Parameters:
        `message` - the message to log
        `cause` - the cause of the message

    - #### debug

          public void debug​(java.lang.String message,
                            java.lang.Throwable cause)

      Description copied from interface: `Logger`
      Logs a debug message.

      Enabling debugging can result in a very large number of log messages, and may slow down deduplication. It should only be enabled under the direction of your TIBO support representative.

      Specified by:
        `debug` in interface `Logger`
      Parameters:
        `message` - the message to log
        `cause` - the cause of the message

    - #### info

          public void info​(java.lang.String message,
                           java.lang.Throwable cause)

      Description copied from interface: `Logger`
      Logs an informational message.

      Enabling informational messages will result in verbose log messages.

      Specified by:
        `info` in interface `Logger`
      Parameters:
        `message` - the message to log
        `cause` - the cause of the message

    - #### warn

          public void warn​(java.lang.String message,
                           java.lang.Throwable cause)

      Description copied from interface: `Logger`
      Logs a warning message.
      Specified by:
        `warn` in interface `Logger`
      Parameters:
        `message` - the message to log
        `cause` - the cause of the message

    - #### error

          public void error​(java.lang.String message,
                            java.lang.Throwable cause)

      Description copied from interface: `Logger`
      Logs an error message.
      Specified by:
        `error` in interface `Logger`
      Parameters:
        `message` - the message to log
        `cause` - the cause of the message

    - #### fatal

          public void fatal​(java.lang.String message,
                            java.lang.Throwable cause)

      Description copied from interface: `Logger`
      Logs a fatal message.

      The framework will usually cease processing shortly after emitting a fatal message.

      Specified by:
        `fatal` in interface `Logger`
      Parameters:
        `message` - the message to log
        `cause` - the cause of the message