|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.log.LogWriter
public abstract class LogWriter
LogWriter is responsible for writing information to individual destinations.
A LogWriter has an assigned log level (by default LogLevel.ALL
), which
specifies what information to write and what to ignore. A log level of
LogLevel.OFF
will ignore any write requests. If a LogWriter is not used
anymore, close()
has to be called.
LogLevel
,
LogService
Constructor Summary | |
---|---|
LogWriter()
|
Method Summary | |
---|---|
abstract void |
close()
Closes the LogWriter and all its resources. |
abstract void |
flush()
Flushes all buffered output. |
static ErrorHandler |
getErrorHandler()
Returns the used error handler. |
LogLevel |
getLogLevel()
Returns the log level used for deciding which messages will be logged. |
static void |
setErrorHandler(ErrorHandler handler)
Sets the error handler used on all log writer errors. |
void |
setLogLevel(LogLevel level)
Sets the log level for deciding which messages gets logged by this LogWriter. |
abstract void |
write(java.lang.String logService,
LogLevel level,
java.lang.String msg)
Writes a message out to this LogWriter. |
abstract void |
write(java.lang.String logService,
LogLevel level,
java.lang.String msg,
java.lang.Throwable t)
Like write(String, LogLevel, String) , in addition a
Throwable object is taken which will be added to the message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LogWriter()
Method Detail |
---|
public abstract void close()
If necessary, all output is flushes before.
public abstract void flush()
public static ErrorHandler getErrorHandler()
ErrorHandler
objectpublic final LogLevel getLogLevel()
LogLevel
public static void setErrorHandler(ErrorHandler handler)
handler
- the new error handlerpublic final void setLogLevel(LogLevel level)
level
- new log levelpublic abstract void write(java.lang.String logService, LogLevel level, java.lang.String msg)
The message has the associated log level level
. It will only be
written if the LogWriter logging level is not more restrictive than
level
. Otherwise the message is ignored. LogWriter is responsible
for formatting the output.
logService
- log service name stating the source of the messagelevel
- log level of messagemsg
- the message to writepublic abstract void write(java.lang.String logService, LogLevel level, java.lang.String msg, java.lang.Throwable t)
write(String, LogLevel, String)
, in addition a
Throwable
object is taken which will be added to the message.
logService
- log service name stating the source of the messagelevel
- log level of messagemsg
- the message to writet
- Throwable object, might be null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |