Class UtilLoggingLevel

  • All Implemented Interfaces:
    Serializable

    public class UtilLoggingLevel
    extends org.apache.log4j.Level
    An extension of the Level class that provides support for java.util.logging Levels.
    Author:
    Scott Deboy (sdeboy@apache.org)
    See Also:
    Serialized Form
    • Constructor Detail

      • UtilLoggingLevel

        protected UtilLoggingLevel​(int level,
                                   String levelStr,
                                   int syslogEquivalent)
        Create new instance.
        Parameters:
        level - numeric value for level.
        levelStr - symbolic name for level.
        syslogEquivalent - Equivalent syslog severity.
    • Method Detail

      • toLevel

        public static UtilLoggingLevel toLevel​(int val,
                                               UtilLoggingLevel defaultLevel)
        Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default.
        Parameters:
        val - numeric value.
        defaultLevel - level to be returned if no level matches numeric value.
        Returns:
        matching level or default level.
      • toLevel

        public static org.apache.log4j.Level toLevel​(int val)
        Gets level matching numeric value.
        Parameters:
        val - numeric value.
        Returns:
        matching level or UtilLoggerLevel.FINEST if no match.
      • getAllPossibleLevels

        public static List<UtilLoggingLevel> getAllPossibleLevels()
        Gets list of supported levels.
        Returns:
        list of supported levels.
      • toLevel

        public static org.apache.log4j.Level toLevel​(String s)
        Get level with specified symbolic name.
        Parameters:
        s - symbolic name.
        Returns:
        matching level or Level.DEBUG if no match.
      • toLevel

        public static org.apache.log4j.Level toLevel​(String sArg,
                                                     org.apache.log4j.Level defaultLevel)
        Get level with specified symbolic name.
        Parameters:
        sArg - symbolic name.
        defaultLevel - level to return if no match.
        Returns:
        matching level or defaultLevel if no match.