|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.util.logging.LogUtil
public final class LogUtil
Various java.util.logging-related utility methods.
| Field Summary | |
|---|---|
static java.util.logging.Level |
INFO_PLUS_1
A Level one higher (towards Level.WARNING) than Level.INFO. |
static java.util.logging.Filter |
LESS_THAN_CONFIG
Regards levels less than Level.CONFIG (e.g. |
static java.util.logging.Filter |
LESS_THAN_INFO
Regards levels less than Level.INFO (e.g. |
static java.util.logging.Filter |
LESS_THAN_WARNING
Regards levels less than Level.WARNING (e.g. |
static java.util.logging.LogManager |
LOG_MANAGER
An alternative to repeated calls to LogManager.getLogManager(). |
static java.util.logging.Logger |
ROOT_LOGGER
Is Logger.getLogger(""). |
static java.util.logging.Level |
WARNING_PLUS_1
A Level one higher (towards Level.SEVERE) than Level.WARNING. |
| Method Summary | ||
|---|---|---|
static java.lang.Boolean |
getLoggingProperty(java.lang.String propertyName,
java.lang.Boolean defaulT)
|
|
static
|
getLoggingProperty(java.lang.String propertyName,
java.lang.Class<T> type)
Evaluates the value of the named property to an object of the given type and returns it. |
|
static
|
getLoggingProperty(java.lang.String propertyName,
java.lang.Class<T> type,
T defaulT)
Evaluates the value of the named property to an object of the given type and returns it, or the
defaulT. |
|
static java.util.logging.Level |
getLoggingProperty(java.lang.String propertyName,
java.util.logging.Level defaulT)
|
|
static long |
getLoggingProperty(java.lang.String propertyName,
java.lang.Long defaulT)
|
|
static java.lang.String |
getLoggingProperty(java.lang.String propertyName,
java.lang.String defaulT)
|
|
static java.util.logging.Filter |
levelLimitFilter(java.util.logging.Level upperBound)
|
|
static Consumer<java.lang.String> |
logConsumer(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String prefix)
Strings passed to the returned Consumer are logged to the given logger at the given level. |
|
static java.io.Writer |
logWriter(java.util.logging.Logger logger,
java.util.logging.Level level,
java.lang.String prefix)
Lines written to the returned Writer are optionally prepended with the given prefix, and then logged
to the given Logger at the given Level. |
|
static Expression |
parseLoggingProperty(java.lang.String propertyName,
Predicate<java.lang.String> isValidVariableNames)
Parses an expression from the value of the named logging property. |
|
static java.lang.String |
requireLoggingProperty(java.lang.String propertyName)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.logging.LogManager LOG_MANAGER
LogManager.getLogManager().
public static final java.util.logging.Logger ROOT_LOGGER
Logger.getLogger("").
public static final java.util.logging.Level WARNING_PLUS_1
Level one higher (towards Level.SEVERE) than Level.WARNING.
public static final java.util.logging.Level INFO_PLUS_1
Level one higher (towards Level.WARNING) than Level.INFO.
public static final java.util.logging.Filter LESS_THAN_WARNING
Level.WARNING (e.g. INFO, CONFIG, FINE, FINER, FINEST) as loggable.
public static final java.util.logging.Filter LESS_THAN_INFO
Level.INFO (e.g. CONFIG, FINE, FINER, FINEST) as loggable.
public static final java.util.logging.Filter LESS_THAN_CONFIG
Level.CONFIG (e.g. FINE, FINER, FINEST) as loggable.
| Method Detail |
|---|
public static Consumer<java.lang.String> logConsumer(java.util.logging.Logger logger,
java.util.logging.Level level,
@Nullable
java.lang.String prefix)
Consumer are logged to the given logger at the given level.
prefix - Is prepended to each string before it is logged
public static java.io.Writer logWriter(java.util.logging.Logger logger,
java.util.logging.Level level,
@Nullable
java.lang.String prefix)
Writer are optionally prepended with the given prefix, and then logged
to the given Logger at the given Level.
public static java.util.logging.Filter levelLimitFilter(java.util.logging.Level upperBound)
Filter that regards levels lower than upperBound as loggable
public static java.lang.Boolean getLoggingProperty(java.lang.String propertyName,
java.lang.Boolean defaulT)
defaulT
public static <T> T getLoggingProperty(java.lang.String propertyName,
java.lang.Class<T> type)
throws ParseException,
EvaluationException
type and returns it.
java.lang.IllegalArgumentException - The logging property is not defined
EvaluationException - The property evaluates to null
EvaluationException - The value of the property is not assignable to T
ParseException
@Nullable
public static <T> T getLoggingProperty(java.lang.String propertyName,
java.lang.Class<T> type,
@Nullable
T defaulT)
throws ParseException,
EvaluationException
type and returns it, or the
defaulT.
ParseException
EvaluationExceptionExpressionEvaluator.evaluateTo(String, de.unkrig.commons.lang.protocol.Mapping, Class)
public static java.util.logging.Level getLoggingProperty(java.lang.String propertyName,
java.util.logging.Level defaulT)
defaulT
java.lang.IllegalArgumentException - The value could not be parsed to a valid level
public static long getLoggingProperty(java.lang.String propertyName,
java.lang.Long defaulT)
defaulT
java.lang.IllegalArgumentException - The property text cannot be parsed into a LONG
@Nullable
public static java.lang.String getLoggingProperty(java.lang.String propertyName,
@Nullable
java.lang.String defaulT)
defaulTpublic static java.lang.String requireLoggingProperty(java.lang.String propertyName)
java.lang.IllegalArgumentException - The named logging property is not defined
public static Expression parseLoggingProperty(java.lang.String propertyName,
Predicate<java.lang.String> isValidVariableNames)
throws ParseException
java.lang.IllegalArgumentException - The named logging property is not defined
ParseException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||