de.esprit.common.log.logpr

## Class LogPrinterFrame

- java.lang.Object
- - de.esprit.common.log.AbstractLogPrinter
  - - de.esprit.common.log.logpr.LogPrinterFrame

- All Implemented Interfaces:
    LogLevelEvent.Source, LogPrinter, java.io.Closeable, java.lang.AutoCloseable

      public class LogPrinterFrame
      extends AbstractLogPrinter

  This class prints tracing output to a MessageConsole widget in a GUI frame. A LogFrame is automatically opened at construction and allows the user to control the log messaging interactively.
  Author:
    Rainer Buesch
  See Also:
    `LogChannel`, `LogFrame`, `LogConsole`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogPrinterFrame(LogChannel channel, java.lang.String title)` Opens a GUI LogFrame over the given channel with the given frame-title.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this `LogPrinter` and deregisters it from the underlying `LogChannel`.
    `LogFrame` | `getLogFrame()` Returns a reference to the LogFrame currently in use.
    `TextPrintable` | `getOutput(LogLevel currLevel)` Overridden to print the output into a MessageConsole.
    `java.lang.String` | `getTypeString()` Returns a string identifying the type of this LogPrinter.
    `protected void` | `processLogMessage(TextPrintable output, LogFormatter formatter, LogMessageEvent e)` Gives subclasses a chance to hook in before printing the logMessage
    `void` | `registerForExit(Exitable comp)` Register an object for performing the `exit()` call.
    `void` | `setBufferSize(int buffSize)` Sets buffer size of the frame's MessageConsole - thus it's display is limited to the given number of lines.
    `void` | `setLogLevel(LogLevel level)` Overridden to pass the setting to the frame's internal LevelChoice component.
    `void` | `setSilent(boolean state)` Sets this `LogPrinter` into silent mode.

    - ### Methods inherited from class de.esprit.common.log.AbstractLogPrinter

      `addLogLevelListener, getLogChannel, getLogFormatter, getLogLevel, getLogMessageListener, isClosed, isSilent, removeLogLevelListener, setLogFormatter, toString`

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

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

- - ### Constructor Detail

    - #### LogPrinterFrame

          public LogPrinterFrame(LogChannel channel,
                         java.lang.String title)

      Opens a GUI LogFrame over the given channel with the given frame-title.

  - ### Method Detail

    - #### getLogFrame

          public final LogFrame getLogFrame()

      Returns a reference to the LogFrame currently in use.

    - #### registerForExit

          public final void registerForExit(Exitable comp)

      Register an object for performing the `exit()` call. If no object is registered the frame itself will perform a `System.exit(0)` when the 'Exit' button is clicked.

    - #### setLogLevel

          public final void setLogLevel(LogLevel level)

      Overridden to pass the setting to the frame's internal LevelChoice component.
      Specified by:
        `setLogLevel` in interface `LogPrinter`
      Overrides:
        `setLogLevel` in class `AbstractLogPrinter`

    - #### getOutput

          public final TextPrintable getOutput(LogLevel currLevel)

      Overridden to print the output into a MessageConsole.

    - #### setBufferSize

          public final void setBufferSize(int buffSize)

      Sets buffer size of the frame's MessageConsole - thus it's display is limited to the given number of lines.

    - #### close

          public void close()

      Description copied from class: `AbstractLogPrinter`
      Closes this `LogPrinter` and deregisters it from the underlying `LogChannel`.
      Specified by:
        `close` in interface `LogPrinter`
      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Overrides:
        `close` in class `AbstractLogPrinter`

    - #### getTypeString

          public java.lang.String getTypeString()

      Description copied from interface: `LogPrinter`
      Returns a string identifying the type of this LogPrinter.

    - #### setSilent

          public void setSilent(boolean state)

      Description copied from interface: `LogPrinter`
      Sets this `LogPrinter` into silent mode. No further output will occur. Note that this does not affect the current `LogLevel`. After re-enabling reporting will continue in current `LogLevel`.
      Specified by:
        `setSilent` in interface `LogPrinter`
      Overrides:
        `setSilent` in class `AbstractLogPrinter`

    - #### processLogMessage

          protected void processLogMessage(TextPrintable output,
                               LogFormatter formatter,
                               LogMessageEvent e)

      Description copied from class: `AbstractLogPrinter`
      Gives subclasses a chance to hook in before printing the logMessage
      Overrides:
        `processLogMessage` in class `AbstractLogPrinter`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.