public interface LoggingConcern
extends io.csar.Concern
Csar
Modifier and Type | Field and Description |
---|---|
static LoggingConcern |
DEFAULT
Default logging concern that essentially does nothing more than delegate to the default SLF4J configuration.
|
Modifier and Type | Method and Description |
---|---|
default Class<LoggingConcern> |
getConcernType() |
default org.slf4j.Logger |
getLogger(Class<?> contextClass)
Returns an appropriate logger for the given context.
|
org.slf4j.ILoggerFactory |
getLoggerFactory() |
default org.slf4j.Logger |
getRootLogger()
Retrieves root logger of the underlying logging system.
|
default void |
setLogLevel(org.slf4j.event.Level level)
Sets the log level of the root logger.
|
void |
setLogLevel(org.slf4j.Logger logger,
org.slf4j.event.Level level)
Sets the log level of a particular logger.
|
static final LoggingConcern DEFAULT
Retrieving a logger from this logger concern's getLogger(Class)
is equivalent to calling LoggerFactory.getLogger(Class)
.
This logging concern does not support setting the log level.
LoggerFactory.getILoggerFactory()
default Class<LoggingConcern> getConcernType()
getConcernType
in interface io.csar.Concern
@Nonnull org.slf4j.ILoggerFactory getLoggerFactory()
@Nonnull default org.slf4j.Logger getLogger(@Nonnull Class<?> contextClass)
The default implementation delegates to ILoggerFactory.getLogger(String)
using the name of the context class as the logger name.
contextClass
- The context for which logging is to be performed.NullPointerException
- if the given context class is null
.getLoggerFactory()
@Nonnull default org.slf4j.Logger getRootLogger()
getLoggerFactory()
,
Logger.ROOT_LOGGER_NAME
void setLogLevel(@Nonnull org.slf4j.Logger logger, @Nonnull org.slf4j.event.Level level)
logger
- The logger for which the log level should be set.level
- The minimum logging level for which messages should be logged.default void setLogLevel(@Nonnull org.slf4j.event.Level level)
level
- The minimum logging level for which messages should be logged.getRootLogger()
,
setLogLevel(Logger, Level)
Copyright © 2016 GlobalMentor, Inc.. All rights reserved.