Class PluginLogger
- java.lang.Object
-
- de.tsystems.mms.apm.performancesignature.ui.util.PluginLogger
-
public class PluginLogger extends Object
A simple logger that prefixes each message with the plug-in name.- Author:
- Ulli Hafner
-
-
Constructor Summary
Constructors Modifier Constructor Description PluginLogger(PrintStream logger, String pluginName)
Creates a new instance ofPluginLogger
.protected
PluginLogger(String pluginName)
Creates a new instance ofPluginLogger
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
log(String message)
Logs the specified message.void
log(Throwable throwable)
Logs the specified throwable.void
logLines(String lines)
Logs several lines that already contain a prefix.void
printStackTrace(Throwable throwable)
Logs the stack trace of the throwable.protected void
setLogger(PrintStream logger)
Sets the logger to the specified value.
-
-
-
Constructor Detail
-
PluginLogger
public PluginLogger(PrintStream logger, String pluginName)
Creates a new instance ofPluginLogger
.- Parameters:
logger
- the actual print stream to log topluginName
- the plug-in name
-
PluginLogger
protected PluginLogger(String pluginName)
Creates a new instance ofPluginLogger
. Note that the logger needs to be set afterwards to avoid throwing aNullPointerException
.- Parameters:
pluginName
- the plug-in name
-
-
Method Detail
-
setLogger
protected void setLogger(PrintStream logger)
Sets the logger to the specified value.- Parameters:
logger
- the value to set
-
log
public void log(String message)
Logs the specified message.- Parameters:
message
- the message
-
log
public void log(Throwable throwable)
Logs the specified throwable.- Parameters:
throwable
- the throwable
-
printStackTrace
public void printStackTrace(Throwable throwable)
Logs the stack trace of the throwable.- Parameters:
throwable
- the throwable
-
logLines
public void logLines(String lines)
Logs several lines that already contain a prefix.- Parameters:
lines
- the lines to log
-
-