Class DefaultLogger
- All Implemented Interfaces:
ResolverLogger
System.err
.
By default, the DEFAULT_LOGGER_LOG_LEVEL
feature determines
which messages are logged. The valid levels are "debug", "info", "warn", and "none". An invalid level
is treated as "warn".
If the level is set to "debug", all messages will be printed. If set to "info", info and warning messages will be printed. If set to "warn", only warning messages will be printed. If set to "none", no messages are printed.
If the configuration's DEFAULT_LOGGER_LOG_LEVEL
is changed, that change will be
detected by the logger and it will use that level going forward. The value can also be changed
directly by calling setLogLevel(java.lang.String)
. That level will remain in effect as long as the configuration
default does not change.
-
Field Summary
Fields inherited from class org.xmlresolver.logging.AbstractLogger
CACHE, catalogLogging, categories, CONFIG, DEBUG, ERROR, INFO, NONE, REQUEST, RESPONSE, TRACE, WARN, WARNING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Writes a debug message toSystem.err
.Get the current logging level.void
Writes an informational message toSystem.err
.void
setLogLevel
(String level) Set the current logging level.void
Writes a warning message toSystem.err
.Methods inherited from class org.xmlresolver.logging.AbstractLogger
getCategory, log, logMessage, setCategory
-
Constructor Details
-
DefaultLogger
Initialize the logger.The
DEFAULT_LOGGER_LOG_LEVEL
is obtained from the configuration.- Parameters:
config
- The resolver configuration.
-
-
Method Details
-
getLogLevel
Get the current logging level.- Returns:
- the current logging level
-
setLogLevel
Set the current logging level.- Parameters:
level
- The logging level.
-
info
Writes an informational message toSystem.err
.- Parameters:
message
- The message.
-
debug
Writes a debug message toSystem.err
.- Parameters:
message
- The message.
-
warn
Writes a warning message toSystem.err
.- Parameters:
message
- The message.
-