java.lang.Object
net.i2p.util.LogLimit

class LogLimitextends Object
Defines the log limit for a particular set of logs.
  • Constructor Details

    • LogLimit

      public LogLimit(String name, int limit)
      Binds a minimum priority level to every log under the given root name.
      Parameters:
      name - the root log name this override applies to, matched by class hierarchy
      limit - the minimum priority level, from Log.toLevelString(int), that logs under this root name will emit
  • Method Details

    • getRootName

      public String getRootName()
      Root name matched by this limit.
      Returns:
      the root name
    • getLimit

      public int getLimit()
      Priority limit applied to matching logs.
      Returns:
      the minimum priority level that logs under the root name emit
    • setLimit

      public void setLimit(int limit)
      Configure the priority limit.
      Parameters:
      limit - the minimum priority level that logs under this root name emit
    • matches

      public boolean matches(Log log)
      Whether the log matches this limit, by name or class hierarchy.
      Parameters:
      log - the log to test, whose class name is compared against the root name
      Returns:
      true if this limit applies to that log, false if the name is absent or is a different log entirely
    • hashCode

      public int hashCode()
      Hash code derived from the root name.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • equals

      public boolean equals(Object o)
      Compare by root name.
      Overrides:
      equals in class Object