Package org.xmlresolver.logging
Class AbstractLogger
java.lang.Object
org.xmlresolver.logging.AbstractLogger
- All Implemented Interfaces:
ResolverLogger
- Direct Known Subclasses:
DefaultLogger
,SystemLogger
The abstract logger implements some of the core functionality needed regardless of
how the messages are processed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Messages related to how the cache is used.protected String
static final String
Messages related to resolver configuration.protected static final int
static final String
Error messages.protected static final int
protected static final int
static final String
Requests for resource resolution.static final String
Responses describing how a request was resolved.static final String
Trace (or debuggin) messages.protected static final int
static final String
Warning messages. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCategory
(String cat) Returns the log level, "debug", "info", worn", or "none" associated with a category.void
Log a message.protected String
logMessage
(String cat, String message, Object... params) void
setCategory
(String cat, String level) Set the log level for a category.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xmlresolver.logging.ResolverLogger
debug, info, warn
-
Field Details
-
REQUEST
Requests for resource resolution.- See Also:
-
RESPONSE
Responses describing how a request was resolved.- See Also:
-
TRACE
Trace (or debuggin) messages.- See Also:
-
ERROR
Error messages.- See Also:
-
CACHE
Messages related to how the cache is used.- See Also:
-
CONFIG
Messages related to resolver configuration.- See Also:
-
WARNING
Warning messages.- See Also:
-
DEBUG
protected static final int DEBUG- See Also:
-
INFO
protected static final int INFO- See Also:
-
WARN
protected static final int WARN- See Also:
-
NONE
protected static final int NONE- See Also:
-
categories
-
catalogLogging
-
-
Constructor Details
-
AbstractLogger
public AbstractLogger()Initializes properties of the abstract class.
-
-
Method Details
-
getCategory
Returns the log level, "debug", "info", worn", or "none" associated with a category.- Specified by:
getCategory
in interfaceResolverLogger
- 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".- Specified by:
setCategory
in interfaceResolverLogger
- Parameters:
cat
- The category.level
- The level.
-
logMessage
-
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 message and its parameters are formatted with
Formatter
.- Specified by:
log
in interfaceResolverLogger
- Parameters:
cat
- The category.message
- The message.params
- The message parameters.
-