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

class LogLimitextends Object
Defines the log limit for a particular set of logs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Messages allowed before the rest are dropped.
    private final String
    Logger whose output is being limited.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogLimit(String name, int limit)
    Binds a minimum priority level to every log under the given root name.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    boolean
    Compare by root name.
    int
    Priority limit applied to matching logs.
    Root name matched by this limit.
    int
    Hash code derived from the root name.
    boolean
    matches(Log log)
    Whether the log matches this limit, by name or class hierarchy.
    void
    setLimit(int limit)
    Configure the priority limit.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _rootName

      private final String _rootName
      Logger whose output is being limited.
    • _limit

      private int _limit
      Messages allowed before the rest are dropped.
  • 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