Package org.kiwiproject.beta.slf4j
Class KiwiSlf4j
java.lang.Object
org.kiwiproject.beta.slf4j.KiwiSlf4j
Utilities for SLF4J, mainly to allow logging a message at a specified level. Sometimes it is useful to be able
not just to change the log level of loggers at runtime, but also to select the level of specific log statements.
For example, instead of having to hard code a
LOG.debug(...), you can use one of the log methods
in this utility to permit changing the level at which a specific statement is logged. This is more granular than
just changing an entire Logger's level and is extremely useful in some situations.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanisEnabled(org.slf4j.Logger logger, org.slf4j.event.Level level) static voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic org.slf4j.event.LeveltoLevelIgnoreCase(String levelNameString) MatcheslevelNameStringto a value inLevel, independent of the character case (lower or upper).
-
Method Details
-
isEnabled
-
isEnabled
public static boolean isEnabled(org.slf4j.Logger logger, org.slf4j.event.Level level) -
log
-
log
-
log
-
log
-
log
-
log
-
log
-
log
-
log
-
log
-
toLevelIgnoreCase
MatcheslevelNameStringto a value inLevel, independent of the character case (lower or upper).For example, the strings "WARN", "warn", and "Warn" all match
Level.WARN.- Parameters:
levelNameString- a String whose uppercased value maps to one of the values inLevel- Returns:
- the matching SLF4J
Level - Throws:
IllegalArgumentException- iflevelNameStringis blank or there is no matchingLevel
-