Interface ResolverLogger

All Known Implementing Classes:
AbstractLogger, DefaultLogger, SystemLogger

public interface ResolverLogger
The resolver logger interface defines the features of a logging class for the resolver.

The resolver logs messages by calling log(java.lang.String, java.lang.String, java.lang.Object...). The categories are defined as constants in this class. Different log levels can be specified for the different classes. Which levels result in output, and where that output goes depends on the back end. DefaultLogger sends messages to standard error. SystemLogger connects to a logging backend. Configuring the logging backend is performed at runtime according to the mechanisms defined for that backend. That level of configuration is outside the scope of the resolver logger.

The log levels are "debug", "info", and "warn". Exactly what levels make sense and how they're mapped to different backends is a little arbitrary. Debug level messages describe in detail how a request is processed. Info level messages are summaries of processing, likely one or two per request. Warning messages indicate that an error has been detected. The resolver tries to be very forgiving of errors, ignoring most conditions rather than throwing exceptions.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(String message)
    Process a debug or "trace" message.
    Returns the log level, "debug", "info", or worn", associated with a category.
    void
    info(String message)
    Process an informational message.
    void
    log(String cat, String message, Object... params)
    Log a message.
    void
    setCategory(String cat, String level)
    Set the log level for a category.
    void
    warn(String message)
    Process a warning message.
  • Method Details

    • getCategory

      String getCategory(String cat)
      Returns the log level, "debug", "info", or worn", associated with a category.
      Parameters:
      cat - The category.
      Returns:
      The level. If no level has been configured for that category, the default is "debug".
    • setCategory

      void setCategory(String cat, String level)
      Set the log level for a category. After this call, messages in the specified category will be logged at the specified level. Valid levels are "debug", "info", and "warn". An invalid level is treated as "debug".
      Parameters:
      cat - The category.
      level - The level.
    • log

      void log(String cat, String message, Object... params)
      Log a message.

      The category is used to determine what level of logging is expected for this message. The message is then formatted with its parameters and logged.

      The actual logging is done by the warn(java.lang.String), info(java.lang.String), and debug(java.lang.String) methods, but they are never called directly by the resolver.

      The message and its parameters are formatted with Formatter.

      Parameters:
      cat - The category.
      message - The message.
      params - The message parameters.
    • warn

      void warn(String message)
      Process a warning message.
      Parameters:
      message - The message.
    • info

      void info(String message)
      Process an informational message.
      Parameters:
      message - The message.
    • debug

      void debug(String message)
      Process a debug or "trace" message.
      Parameters:
      message - The message.