|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.qfs.lib.log.AbstractLogUser
This class provides a default implementation of the LogUser
interface that reduces the effort of writing a new LogFilter
to implementing the isUseful
method.
The filter
methods are implemented according to the filter
mode setting as documented in LogUser
.
Useful messages are passed to a LogWriter
that can be set
via setLogWriter
.
Field Summary | |
protected int |
mode
The LogUser mode. |
Fields inherited from interface de.qfs.lib.log.LogUser |
FILTER_ALL, FILTER_NONE, FILTER_UNUSED, FILTER_USED |
Constructor Summary | |
AbstractLogUser(int mode,
LogWriter writer)
Create a new AbstractLogUser. |
Method Summary | |
boolean |
filter(LogEntry entry)
Filter a LogEntry and possibly write it to the LogWriter. |
LogEntry[] |
filter(LogEntry[] entries)
Filter an array of LogEntries, possibly writing some of them to the LogWriter. |
LogWriter |
getLogWriter()
Get the LogWriter of the AbstractLogUser. |
protected abstract boolean |
isUseful(LogEntry entry)
Decide whether a log message is useful and should be passed to the LogWriter. |
void |
setFilterMode(int mode)
Configure the AbstractLogUser's filter mode. |
void |
setLogWriter(LogWriter writer)
Set the LogWriter of the AbstractLogUser. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int mode
LogUser
mode.Constructor Detail |
public AbstractLogUser(int mode, LogWriter writer)
mode
- The LogUser
mode.writer
- The LogWriter to write entries to.Method Detail |
public final LogWriter getLogWriter()
public final void setLogWriter(LogWriter writer)
writer
- The writer to set.public boolean filter(LogEntry entry)
filter
in interface LogFilter
logEntry
- The entry to filter.public LogEntry[] filter(LogEntry[] entries)
filter
in interface LogFilter
entries
- The entries to filter.public void setFilterMode(int mode)
setFilterMode
in interface LogUser
mode
- The mode to set.protected abstract boolean isUseful(LogEntry entry)
entry
- The LogEntry to check.
|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |