|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.logging.Formatter
de.unkrig.commons.util.logging.formatter.SelectiveFormatter
public class SelectiveFormatter
A Formatter calls one of two delegates, depending on the evaluation result of a LogRecord Predicate.
| Constructor Summary | |
|---|---|
SelectiveFormatter(Predicate<java.util.logging.LogRecord> predicate,
java.util.logging.Formatter delegate1,
java.util.logging.Formatter delegate2)
|
|
| Method Summary | |
|---|---|
java.lang.String |
format(java.util.logging.LogRecord logRecord)
Calls delegate1 if the predicate evaluates to true for the logRecord,
otherwise delegate2. |
static java.util.logging.Formatter |
loggerLevelGreaterThan(java.util.logging.Level threshold,
java.util.logging.Formatter delegate1,
java.util.logging.Formatter delegate2)
Returns a Formatter that for each LogRecord invokes delegate1 if the level of the
processing Logger is greater than threshold, and for all other the delegate2. |
static java.util.logging.Formatter |
logRecordLevelGreaterThan(java.util.logging.Level threshold,
java.util.logging.Formatter delegate1,
java.util.logging.Formatter delegate2)
Returns a Formatter that for each LogRecord invokes delegate1 if the level of the log
record is greater than ("more severe than") threshold, and for all other the delegate2. |
| Methods inherited from class java.util.logging.Formatter |
|---|
formatMessage, getHead, getTail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SelectiveFormatter(Predicate<java.util.logging.LogRecord> predicate,
java.util.logging.Formatter delegate1,
java.util.logging.Formatter delegate2)
delegate1 - Is called for LogRecord for which the predicate evaluates to truedelegate2 - Is called for LogRecord for which the predicate evaluates to false| Method Detail |
|---|
public java.lang.String format(java.util.logging.LogRecord logRecord)
delegate1 if the predicate evaluates to true for the logRecord,
otherwise delegate2.
format in class java.util.logging.FormatterSelectiveFormatter(Predicate, Formatter, Formatter)
public static final java.util.logging.Formatter loggerLevelGreaterThan(java.util.logging.Level threshold,
java.util.logging.Formatter delegate1,
java.util.logging.Formatter delegate2)
Formatter that for each LogRecord invokes delegate1 if the level of the
processing Logger is greater than threshold, and for all other the delegate2.
A typical application is to format log records WITHOUT stack traces, except if the logger's level is set to
Level.FINE or lower.
public static final java.util.logging.Formatter logRecordLevelGreaterThan(java.util.logging.Level threshold,
java.util.logging.Formatter delegate1,
java.util.logging.Formatter delegate2)
Formatter that for each LogRecord invokes delegate1 if the level of the log
record is greater than ("more severe than") threshold, and for all other the delegate2.
A typical application is to format log records WITHOUT stack traces, except if the logger's level is set to
Level.FINE or lower.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||