Class 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
      The ALL has the lowest possible rank and is intended to turn on all logging.
      static int ALL_INT  
      static Level DEBUG
      The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
      static int DEBUG_INT  
      static Level ERROR
      The ERROR level designates error events that might still allow the application to continue running.
      static int ERROR_INT  
      static Level INFO
      The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
      static int INFO_INT  
      static Level OFF
      The OFF has the highest possible rank and is intended to turn off logging.
      static int OFF_INT  
      static Level TRACE
      The TRACE Level designates finer-grained informational events than the DEBUG level.
      static int TRACE_INT  
      static Level WARN
      The WARN 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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • OFF

        public static final Level OFF
        The OFF has the highest possible rank and is intended to turn off logging.
      • ERROR

        public static final Level ERROR
        The ERROR level designates error events that might still allow the application to continue running.
      • WARN

        public static final Level WARN
        The WARN level designates potentially harmful situations.
      • INFO

        public static final Level INFO
        The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
      • DEBUG

        public static final Level DEBUG
        The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
      • TRACE

        public static final Level TRACE
        The TRACE Level designates finer-grained informational events than the DEBUG level.
      • ALL

        public static final Level ALL
        The ALL has the lowest possible rank and is intended to turn on all logging.
    • Constructor Detail

      • Level

        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 Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isGreaterOrEqual

        public boolean isGreaterOrEqual​(Level r)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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.