|
RSE Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.logging.Logger
public class 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());
//out.logDebugMessage(
// "myPlugin",
// "this is a debug message from class myPlugin.");
......
......
}
public void shutdown() throws CoreException {
super.shutdown();
LoggerFactory.freeInst(this);
}
Field Summary | |
---|---|
static boolean |
DEBUG
Constant can be used to surround debugging code. |
static int |
LOG_DEBUG
Set debug_level to this value to get Debug messages. |
static int |
LOG_ERROR
Set debug_level to this value to get Error messages. |
static int |
LOG_INFO
Set debug_level to this value to get Information messages. |
static int |
LOG_WARNING
Set debug_level to this value to get Warning messages. |
static String |
LOGGING_LEVEL
Name of the key that controls the logging level. |
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(Preferences.PropertyChangeEvent event)
Handle changes from a 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 boolean DEBUG
public static final String LOGGING_LEVEL
public static final int LOG_ERROR
public static final int LOG_WARNING
public static final int LOG_INFO
public static final int LOG_DEBUG
Method Detail |
---|
public void freeResources()
public int getDebugLevel()
public void logDebugMessage(String className, String message)
public void logError(String message, Throwable ex)
message
- the message to log.ex
- the exception that caused the condition, may be null.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 propertyChange(Preferences.PropertyChangeEvent event)
propertyChange
in interface Preferences.IPropertyChangeListener
public void setDebugLevel(int level)
|
RSE Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |