public final class GenericDebugLogger
extends java.lang.Object
PirolPlugInSettings
,
PersonalLogger
Modifier and Type | Field and Description |
---|---|
protected boolean |
eclipseFriendlyOutput
format the output string so that eclipse supports jumping into the
correct file and line number when clicking on the output.
|
protected static java.lang.String |
KEY_ECLIPSEFRIENDLYOUTPUT |
protected static java.lang.String |
KEY_LOGLEVEL |
protected static java.lang.String |
KEY_PRINTFILEANDLINE |
protected static java.lang.String |
KEY_PRINTNEWLINEFIRST |
protected static java.lang.String |
KEY_PRINTSHORTCLASSNAMES |
protected static java.lang.String |
KEY_PRINTTIMESTAMPS |
protected static java.lang.String |
KEY_PRINTUSERNAMES |
protected static java.lang.String |
KEY_USELOGFILE |
protected java.io.File |
logFile |
protected int |
logLevel
The logLevel specifies which kinds of messages will be put out.
|
protected boolean |
printFileAndLine
wether or not to print file name and line number in code
|
protected boolean |
printNewLineFirst
print additional line break before output of new messages?
|
protected boolean |
printShortClassNames
print short class names instead of class name plus the whole package path?
|
protected boolean |
printTimeStamp
wether or not to print time stamps in the messages
|
protected boolean |
printUserNames
print user names with every message?
|
protected PropertiesHandler |
properties |
protected static java.lang.String |
propertiesFile |
static int |
SEVERITY_DEBUG
Constant
logLevel for debugging purposes. |
static int |
SEVERITY_ERROR
Constant
logLevel for an error that may invalidate the
current results occured. |
static int |
SEVERITY_MINORERROR
Constant
logLevel for an error that won't have influence on
the results occured. |
static int |
SEVERITY_SEVEREERROR
Constant
logLevel for an error that may invalidate the
current and future results or may crash the VM, etc.. |
static int |
SEVERITY_WARNING
Constant
logLevel for something that might not be good
happened. |
protected static java.lang.String[] |
severityLevels |
protected java.io.PrintStream |
stdErr |
protected java.io.PrintStream |
stdOut |
protected boolean |
useLogFile
use a log file instead of printing messages to the console?
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCallerString(java.lang.Throwable t) |
int |
getLogLevel() |
java.lang.String |
getPropertiesFile() |
boolean |
isPrintFileAndLine() |
boolean |
isPrintNewLineFirst() |
boolean |
isPrintTimeStamp() |
protected void |
loadProperties()
load local configuration file, to check if there are saved directorties for
debugging outputs.
|
protected void |
printDebug(java.lang.String user,
java.lang.String message) |
protected void |
printError(java.lang.String user,
java.lang.String message) |
protected void |
printMessage(java.lang.String user,
int severity,
java.lang.String message) |
protected void |
printMinorError(java.lang.String user,
java.lang.String message) |
protected void |
printSevereError(java.lang.String user,
java.lang.String message) |
protected void |
printWarning(java.lang.String user,
java.lang.String message) |
void |
setErrorStream(java.io.PrintStream err)
Set the stream, where messages with a loglevel >= SEVERITY_MINORERROR are put out.
|
void |
setLogLevel(int logLevel) |
void |
setOutputStream(java.io.PrintStream out)
Set the stream, where messages with a loglevel < SEVERITY_MINORERROR are put out.
|
protected boolean |
showMessagesOfUser(java.lang.String user)
check if the properties contain information on how to treat messages
from this user
|
protected PropertiesHandler properties
protected static final java.lang.String propertiesFile
protected int logLevel
logLevel severity sheme: 0 - debug - just an output for debugging purposes 1 - warning - something that might not be good happened 2 - minor error - an error that won't have influence on the results occured 3 - error - an error that may invalidate the current results occured 4 - severe error - an error that may invalidate the current and future results or may crash the VM, etc.
protected static final java.lang.String KEY_LOGLEVEL
public static final int SEVERITY_DEBUG
logLevel
for debugging purposes.public static final int SEVERITY_WARNING
logLevel
for something that might not be good
happened.public static final int SEVERITY_MINORERROR
logLevel
for an error that won't have influence on
the results occured.public static final int SEVERITY_ERROR
logLevel
for an error that may invalidate the
current results occured.public static final int SEVERITY_SEVEREERROR
logLevel
for an error that may invalidate the
current and future results or may crash the VM, etc..protected static final java.lang.String[] severityLevels
protected boolean eclipseFriendlyOutput
protected static final java.lang.String KEY_ECLIPSEFRIENDLYOUTPUT
protected boolean printTimeStamp
protected static final java.lang.String KEY_PRINTTIMESTAMPS
protected boolean printFileAndLine
protected static final java.lang.String KEY_PRINTFILEANDLINE
protected boolean printNewLineFirst
protected static final java.lang.String KEY_PRINTNEWLINEFIRST
protected boolean printShortClassNames
protected static final java.lang.String KEY_PRINTSHORTCLASSNAMES
protected boolean printUserNames
protected static final java.lang.String KEY_PRINTUSERNAMES
protected java.io.PrintStream stdOut
protected java.io.PrintStream stdErr
protected java.io.File logFile
protected boolean useLogFile
protected static final java.lang.String KEY_USELOGFILE
protected final void loadProperties() throws java.io.IOException
java.io.IOException
- if the file with the given file name could not be accessedprotected final boolean showMessagesOfUser(java.lang.String user)
user
- user id to checkprotected final void printMessage(java.lang.String user, int severity, java.lang.String message)
protected final java.lang.String getCallerString(java.lang.Throwable t)
protected final void printDebug(java.lang.String user, java.lang.String message)
protected final void printWarning(java.lang.String user, java.lang.String message)
protected final void printMinorError(java.lang.String user, java.lang.String message)
protected final void printError(java.lang.String user, java.lang.String message)
protected final void printSevereError(java.lang.String user, java.lang.String message)
public final int getLogLevel()
public final void setLogLevel(int logLevel)
logLevel
- public final boolean isPrintFileAndLine()
public final boolean isPrintNewLineFirst()
public final boolean isPrintTimeStamp()
public final java.lang.String getPropertiesFile()
public final void setOutputStream(java.io.PrintStream out)
out
- stream for debugging outputpublic final void setErrorStream(java.io.PrintStream err)
err
- stream for debugging output