Interface PaxLevel


  • public interface PaxLevel
    Framework library agnostic representation of logging level. There are two uses of level concept:
    • detail level or importance of logging event
    • threshold of the logging service, appender or destination, that allows to process or reject logging events with some level
    Terms like higher or lower may be confusing at first glance. Each framework may use different numerical levels than other. Syslog and LogService use higher numerical values for less important logging events. Log4J1 and java.util.logging use higher numerical values for more important events. This interface is based on Log4J1 and:
    • the higher value (numerically) the more important the event is (higher severity)
    • INFO is higher than DEBUG
    • when used as threshold, PaxLevel=INFO rejects events with level=DEBUG and level=TRACE.
    • also, the higher the threshold the more events are rejected (less are processed).
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getSyslogEquivalent()
      Return the syslog equivalent of this priority as an integer.
      boolean isGreaterOrEqual​(PaxLevel r)
      Returns true if this level has a higher or equal level (is more important, has bigger severity) than the level passed as argument, false otherwise.
      org.osgi.service.log.LogLevel toLevel()
      Returns LogLevel representation of this level.
    • Method Detail

      • isGreaterOrEqual

        boolean isGreaterOrEqual​(PaxLevel r)
        Returns true if this level has a higher or equal level (is more important, has bigger severity) than the level passed as argument, false otherwise.
        Parameters:
        r - the PaxLevel to compare with.
        Returns:
        true if this level has a higher or equal level than the level passed as argument, false otherwise.
      • toLevel

        org.osgi.service.log.LogLevel toLevel()
        Returns LogLevel representation of this level. In LogLevel enum, the higher the numerical value (ordinal of the enum), the less important is the logging event with given level. When used as threshold, the higher the numerical value, the less events are rejected (i.e., high threshold means process even less important events).
      • getSyslogEquivalent

        int getSyslogEquivalent()
        Return the syslog equivalent of this priority as an integer. In Syslog (https://en.wikipedia.org/wiki/Syslog#Severity_level), higher numerical values indicate less important logging events.
        Returns:
        the syslog equivalent of this priority as an integer.