com.ccg.swing
Class SystemLogModel

java.lang.Object
  extended by com.ccg.swing.AbstractLogModel
      extended by com.ccg.swing.SystemLogModel
All Implemented Interfaces:
LogModel

public final class SystemLogModel
extends AbstractLogModel

A implementation of the LogModel which controls the JVM's log and debug output messages.

This LogModel allows one to directly control the logging/debug levels of the static Log object which is being used by the active JVM. If you adjust the values from this model, you will adjust the verbosity of the Log/Debug message produced by the active application.

Since there is only one common instance of the system logger, you can not construct this object, you can however, gain access to the single instance of the object which exists in the JVM}.

A typical use of this class might look like the following: LogEditor le = new LogEditor(SystemLogModel.getInstance());

To see a working example of using the LogModel, DefaultLogModel, SystemLogModel and LogEditor objects in combination, take a look at LogTest.java.

Since:
1.0
Version:
$Revision: 1.1 $
Author:
$Author: pkb $
See Also:
AbstractLogModel, DefaultLogModel, LogEditor

Method Summary
 int getDebugLevel()
          Get the current debug level for debug messages.
static LogModel getInstance()
          Get access to the LogModel for the applications log control.
 int getLogLevel()
          Get the current log level for logged messages.
 void setDebugLevel(int val)
          Set the current debug level for debug messages.
 void setLogLevel(int val)
          Set the current log level for logged messages.
 
Methods inherited from class com.ccg.swing.AbstractLogModel
addChangeListener, fireChangeEvent, removeChangeListener, toString, validateDebugLevel, validateLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getLogLevel

public int getLogLevel()
Description copied from interface: LogModel
Get the current log level for logged messages.

Returns:
Current int value assigned.
See Also:
LogModel.setLogLevel(int)

setLogLevel

public void setLogLevel(int val)
Description copied from interface: LogModel
Set the current log level for logged messages.

Note, if you attempt to set a invalid value, it will be silently ignored.

Parameters:
val - New int value to assign.
See Also:
LogModel.getLogLevel()

getDebugLevel

public int getDebugLevel()
Description copied from interface: LogModel
Get the current debug level for debug messages.

Returns:
Current int value assigned.
See Also:
LogModel.setDebugLevel(int)

setDebugLevel

public void setDebugLevel(int val)
Description copied from interface: LogModel
Set the current debug level for debug messages.

Note, if you attempt to set a invalid value, it will be silently ignored.

Parameters:
val - New int value to assign.
See Also:
LogModel.getDebugLevel()

getInstance

public static LogModel getInstance()
Get access to the LogModel for the applications log control.

If the application has been built to use the Log and Debug classes for logging information, this method can be used to gain access to a LogModel object associated with these two static objects.

By using this, you can allow the user to control the log output verbosity of the active application.

This is the only way to gain access to a object of this type (as you can not construct these objects directly).

Returns:
A reference to the LogModel object that is tied to the JVM's (active application's) Log/Debug output.
Since:
1.0


Copyright 1998-1998-2006 null. All Rights Reserved.