|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.tc.utils.logging.Log
public class Log
This class provides logging functionality for the whole project. By default, this class has one console writer. New writers can be added and removed at runtime. It is also possible to read the configuration for logging from a string-value (which can be defined in a configuration-file).
Constructor Summary | |
---|---|
Log()
|
Method Summary | |
---|---|
static void |
addOutStream(LogGenericOutputHandler handler)
Add an output handler to the list of writers |
static void |
appendEclipseMarkers(boolean append)
This method allows users to specify if markers for Eclipse should be appended to log messages. |
static void |
debug(java.lang.String msg)
Log a debug message |
static void |
err(java.lang.Exception e)
Log an error-message. |
static void |
err(java.lang.String msg)
Log an error-message. |
static void |
err(java.lang.String msg,
java.lang.Exception e)
Log an error-message. |
static void |
flushLogLevelSpecific()
This method is used to reset all class-specific logging configurations. |
static void |
flushLogLevelSpecific(java.lang.Class classinfo)
This method is used to delete the logging setting for a specific class. |
static short |
getLogLevel()
This method allows users to query the current log level. |
static void |
info(java.lang.String msg)
Log an informative message |
static void |
logMsg(short level,
java.lang.String msg)
This method writes the log-message to all registered writers along with additional information like the current system-time, the calling method, the name of the calling class and the line number. |
static void |
readConfig(java.lang.String config)
Read the configuration of the Logging-class from the given string. |
static void |
setLogLevel(java.lang.Class classinfo,
short level)
This method allows users to modify the current log level for a specific class. |
static void |
setLogLevel(short level)
This method allows users to modify the current log level. |
static void |
warn(java.lang.String msg)
Log a warning message. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Log()
Method Detail |
---|
public static void readConfig(java.lang.String config)
stdout: write logging-output to the console file: write logging-output to a file. The filename is given after a colon. Example: file:/tmp/log.txt none: null-writer. does not printout logging outputThe method not only reads the provided configuration but also sets up the output streams accordingly.
config
- public static void setLogLevel(short level)
public static short getLogLevel()
public static void setLogLevel(java.lang.Class classinfo, short level)
public static void appendEclipseMarkers(boolean append)
public static void flushLogLevelSpecific()
public static void flushLogLevelSpecific(java.lang.Class classinfo)
public static void addOutStream(LogGenericOutputHandler handler)
handler
- new output handler for writing logging outputpublic static void logMsg(short level, java.lang.String msg)
level
- the log level (as defined in the LogLevels class)msg
- the log-message itselfpublic static void err(java.lang.String msg)
msg
- message to logpublic static void err(java.lang.Exception e)
e
- reference to the exception to logpublic static void err(java.lang.String msg, java.lang.Exception e)
e
- reference to the exception to logmsg
- message to logpublic static void warn(java.lang.String msg)
msg
- message to logpublic static void info(java.lang.String msg)
msg
- message to logpublic static void debug(java.lang.String msg)
msg
- message to log
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |