|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.etools.systems.logging.Logger
Generic Logger class for handling Remote Systems logging and tracing.
The debug level is determined by a "debug_level" key in the preferences store
of the plugin that owns this Logger instance.
The debug location is determined by a "log_location" key in the preferences store
of the plugin that owns this Logger instance.
The valid values for these keys can be found in the javadocs for IRemoteSystemsLogging.
.
This means that these keys could have been defined through hardcoding in your
plugin startup code, through preferences.ini in the plugin install directory,
OR from pref_store.ini in the plugin read/write metadata area.
The default behavior is to log to file, and to log only errors.
A typical usage of this class is as follows:
public class myPlugin extends AbstractUIPlugin {
// a cached Logger inst for convenience.
public static Logger out = null;
public myPlugin(IPluginDescriptor descriptor) {
super(descriptor);
......
......
out = LoggerFactory.getInst(this);
out.logInfo("loading myPlugin class.");
//out.logWarning("This is a warning message.");
//out.logError("This is an error.", new Exception());
//if (Logger.DEBUG)
// out.logDebugMessage(
// "myPlugin",
// "this is a debug message from class myPlugin.");
......
......
}
public void shutdown() throws CoreException {
super.shutdown();
LoggerFactory.freeInst(this);
}
Field Summary | |
---|---|
static String |
Copyright
|
static boolean |
DEBUG
This SHOULD be set to false in production. |
Constructor Summary | |
---|---|
protected |
Logger(AbstractUIPlugin systemPlugin)
|
Method Summary | |
---|---|
void |
freeResources()
|
int |
getDebugLevel()
|
void |
logDebugMessage(String className,
String message)
Log a Debug message. |
void |
logError(String message,
Throwable ex)
Log an Error message with an exception. |
void |
logInfo(String message)
Log an Information message. |
void |
logInfo(String message,
Throwable ex)
Log an Information message. |
void |
logWarning(String message)
Log a Warning message. |
void |
logWarning(String message,
Throwable ex)
Log a Warning message. |
void |
propertyChange(PropertyChangeEvent event)
Handle changes from Preferences page. |
void |
setDebugLevel(int level)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String Copyright
public static final boolean DEBUG
Constructor Detail |
protected Logger(AbstractUIPlugin systemPlugin)
Method Detail |
public void logDebugMessage(String className, String message)
public void logError(String message, Throwable ex)
public void logInfo(String message)
public void logInfo(String message, Throwable ex)
public void logWarning(String message)
public void logWarning(String message, Throwable ex)
public void setDebugLevel(int level)
public int getDebugLevel()
public void freeResources()
public void propertyChange(PropertyChangeEvent event)
|
Remote Systems v6.4.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |