Interface ResolverLogger
- All Known Implementing Classes:
AbstractLogger
,DefaultLogger
,SystemLogger
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 TypeMethodDescriptionvoid
Process a debug or "trace" message.getCategory
(String cat) Returns the log level, "debug", "info", or worn", associated with a category.void
Process an informational message.void
Log a message.void
setCategory
(String cat, String level) Set the log level for a category.void
Process a warning message.
-
Method Details
-
getCategory
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
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
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)
, anddebug(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
Process a warning message.- Parameters:
message
- The message.
-
info
Process an informational message.- Parameters:
message
- The message.
-
debug
Process a debug or "trace" message.- Parameters:
message
- The message.
-