Package com.linkedin.alpini.consts
Class Level
- java.lang.Object
-
- com.linkedin.alpini.consts.Level
-
public class Level extends java.lang.Object
This 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 Level
ALL
TheALL
has the lowest possible rank and is intended to turn on all logging.static int
ALL_INT
static Level
DEBUG
TheDEBUG
Level designates fine-grained informational events that are most useful to debug an application.static int
DEBUG_INT
static Level
ERROR
TheERROR
level designates error events that might still allow the application to continue running.static int
ERROR_INT
static Level
INFO
TheINFO
level designates informational messages that highlight the progress of the application at coarse-grained level.static int
INFO_INT
static Level
OFF
TheOFF
has the highest possible rank and is intended to turn off logging.static int
OFF_INT
static Level
TRACE
TheTRACE
Level designates finer-grained informational events than theDEBUG
level.static int
TRACE_INT
static Level
WARN
TheWARN
level designates potentially harmful situations.static int
WARN_INT
-
Constructor Summary
Constructors Modifier Constructor Description protected
Level(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 boolean
equals(java.lang.Object o)
static Level
getLevel(org.apache.logging.log4j.Logger logger)
int
hashCode()
static boolean
isEnabledFor(org.apache.logging.log4j.Logger logger, Level level)
boolean
isGreaterOrEqual(Level r)
static void
logWithLevel(org.apache.logging.log4j.Logger logger, Level level, java.lang.String txt, java.lang.Object... args)
Log at the specified level.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.java.lang.String
toString()
-
-
-
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
TheOFF
has the highest possible rank and is intended to turn off logging.
-
ERROR
public static final Level ERROR
TheERROR
level designates error events that might still allow the application to continue running.
-
WARN
public static final Level WARN
TheWARN
level designates potentially harmful situations.
-
INFO
public static final Level INFO
TheINFO
level designates informational messages that highlight the progress of the application at coarse-grained level.
-
DEBUG
public static final Level DEBUG
TheDEBUG
Level designates fine-grained informational events that are most useful to debug an application.
-
TRACE
public static final Level TRACE
TheTRACE
Level designates finer-grained informational events than theDEBUG
level.
-
ALL
public static final Level ALL
TheALL
has the lowest possible rank and is intended to turn on all logging.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isGreaterOrEqual
public boolean isGreaterOrEqual(Level r)
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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.
-
-