Package com.linkedin.alpini.consts
Class Level
- java.lang.Object
-
- com.linkedin.alpini.consts.Level
-
public class Level extends java.lang.ObjectThis is the subset of org.apache.log4j.Level and org.apache.log4j.Priority with version 1.2.17 Copied here because slf4j does not have a Level concept
-
-
Field Summary
Fields Modifier and Type Field Description static LevelALLTheALLhas the lowest possible rank and is intended to turn on all logging.static intALL_INTstatic LevelDEBUGTheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.static intDEBUG_INTstatic LevelERRORTheERRORlevel designates error events that might still allow the application to continue running.static intERROR_INTstatic LevelINFOTheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.static intINFO_INTstatic LevelOFFTheOFFhas the highest possible rank and is intended to turn off logging.static intOFF_INTstatic LevelTRACETheTRACELevel designates finer-grained informational events than theDEBUGlevel.static intTRACE_INTstatic LevelWARNTheWARNlevel designates potentially harmful situations.static intWARN_INT
-
Constructor Summary
Constructors Modifier Constructor Description protectedLevel(int level, java.lang.String levelStr, java.util.function.Predicate<org.apache.logging.log4j.Logger> isEnabled, com.linkedin.alpini.consts.Level.Log log)Instantiate a Level object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)static LevelgetLevel(org.apache.logging.log4j.Logger logger)inthashCode()static booleanisEnabledFor(org.apache.logging.log4j.Logger logger, Level level)booleanisGreaterOrEqual(Level r)static voidlogWithLevel(org.apache.logging.log4j.Logger logger, Level level, java.lang.String txt, java.lang.Object... args)Log at the specified level.static voidsetLevel(org.apache.logging.log4j.Logger logger, Level level)This uses reflection to call the innards of log4j2 without requiring the module to pull in more than the log4j2Api library.java.lang.StringtoString()
-
-
-
Field Detail
-
OFF_INT
public static final int OFF_INT
- See Also:
- Constant Field Values
-
ERROR_INT
public static final int ERROR_INT
- See Also:
- Constant Field Values
-
WARN_INT
public static final int WARN_INT
- See Also:
- Constant Field Values
-
INFO_INT
public static final int INFO_INT
- See Also:
- Constant Field Values
-
DEBUG_INT
public static final int DEBUG_INT
- See Also:
- Constant Field Values
-
TRACE_INT
public static final int TRACE_INT
- See Also:
- Constant Field Values
-
ALL_INT
public static final int ALL_INT
- See Also:
- Constant Field Values
-
OFF
public static final Level OFF
TheOFFhas the highest possible rank and is intended to turn off logging.
-
ERROR
public static final Level ERROR
TheERRORlevel designates error events that might still allow the application to continue running.
-
WARN
public static final Level WARN
TheWARNlevel designates potentially harmful situations.
-
INFO
public static final Level INFO
TheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.
-
DEBUG
public static final Level DEBUG
TheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.
-
TRACE
public static final Level TRACE
TheTRACELevel designates finer-grained informational events than theDEBUGlevel.
-
ALL
public static final Level ALL
TheALLhas the lowest possible rank and is intended to turn on all logging.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
isGreaterOrEqual
public boolean isGreaterOrEqual(Level r)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
logWithLevel
public static void logWithLevel(org.apache.logging.log4j.Logger logger, Level level, java.lang.String txt, java.lang.Object... args)Log at the specified level. If the "logger" is null, nothing is logged. If the "level" is null, nothing is logged. If the "txt" is null, behaviour depends on the SLF4J implementation.
-
isEnabledFor
public static boolean isEnabledFor(org.apache.logging.log4j.Logger logger, Level level)
-
getLevel
public static Level getLevel(org.apache.logging.log4j.Logger logger)
-
setLevel
public static void setLevel(org.apache.logging.log4j.Logger logger, Level level)This uses reflection to call the innards of log4j2 without requiring the module to pull in more than the log4j2Api library. Since this method should only be used during test setup, there is no need for it to be performant.
-
-