jmri.util
Class JLogoutputFrame

java.lang.Object
  extended by jmri.util.JLogoutputFrame

public class JLogoutputFrame
extends Object

A standalone window for receiving and displaying log outputs

Singleton pattern

The original version deferred initialization onto the Swing thread; this version does it inline, and must be invoked from the Swing thread.

The Frame and the appender are not shown by initializing it but only made ready to receive all log output. It can later be set to visible if desired. TODO: implement also a enable() and disable() method in order to have a minimal impact on performance if not used.

Author:
bender heri See 4/15/2009 Log4J email

Method Summary
static void addFilter(Filter aFilter)
           
 JTextPaneAppender createAppender(JTextPane aTextPane)
          Creates the appender and adds it to all known Loggers whose additivity flag is false, incl. root logger
static Vector<Filter> getFilters()
           
static JLogoutputFrame getInstance()
          Retrieves the singleton instance
static Layout getLayout()
           
 JFrame getMainFrame()
           
 void log(Level aLevel, String aMsg)
          Outputs a message only to the appender which belongs to this frame
static void setFilters(Vector<Filter> aFilters)
           
static void setMyPatternLayout(Layout aLayout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static JLogoutputFrame getInstance()
Retrieves the singleton instance


log

public void log(Level aLevel,
                String aMsg)
Outputs a message only to the appender which belongs to this frame

Parameters:
aLevel -
aMsg -

createAppender

public JTextPaneAppender createAppender(JTextPane aTextPane)
Creates the appender and adds it to all known Loggers whose additivity flag is false, incl. root logger

Parameters:
aTextPane -
Returns:
A configured Appender

getMainFrame

public JFrame getMainFrame()
Returns:
the mainFrame

getLayout

public static Layout getLayout()
Returns:
the myLayout

setMyPatternLayout

public static void setMyPatternLayout(Layout aLayout)
Parameters:
aLayout - the Layout to set

getFilters

public static Vector<Filter> getFilters()
Returns:
the myFilters

setFilters

public static void setFilters(Vector<Filter> aFilters)
Parameters:
aFilters - the Filters to set

addFilter

public static void addFilter(Filter aFilter)
Parameters:
aFilter - the Filter to be added


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads