java.lang.Object
io.github.mmm.base.text.AbstractTextFormatMessageHandler
io.github.mmm.scanner.SimpleTextFormatMessageHandler
- All Implemented Interfaces:
TextFormatMessageHandler
Default implementation of
TextFormatMessageHandler.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Function<TextFormatMessageType, org.slf4j.event.Level> Maps eachTextFormatMessageTypeto its analogLevel.static final Function<TextFormatMessageType, org.slf4j.event.Level> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleTextFormatMessageHandler(boolean throwOnError, org.slf4j.Logger logger, Function<TextFormatMessageType, org.slf4j.event.Level> logLevelMapper, boolean collectMessages) The constructor. -
Method Summary
Methods inherited from class io.github.mmm.base.text.AbstractTextFormatMessageHandler
add, getMessages, isCollectMessages
-
Field Details
-
LOG_MAPPER_DEFAULT
Maps eachTextFormatMessageTypeto its analogLevel. -
LOG_MAPPER_INFO_AS_DEBUG
-
-
Constructor Details
-
SimpleTextFormatMessageHandler
public SimpleTextFormatMessageHandler(boolean throwOnError, org.slf4j.Logger logger, Function<TextFormatMessageType, org.slf4j.event.Level> logLevelMapper, boolean collectMessages) The constructor.- Parameters:
throwOnError- -trueto throw aRuntimeExceptionwhen anerrormessageishandled.logger- theLoggerused to logTextFormatMessages. May benullto omit logging.logLevelMapper- theFunctionto mapTextFormatMessageTypeto the according logLevel.collectMessages- the flag forAbstractTextFormatMessageHandler.isCollectMessages().
-
-
Method Details
-
handle
- Overrides:
handlein classAbstractTextFormatMessageHandler
-
get
- Returns:
- the singleton instance.
-
ofThrowErrors
- Returns:
- a
SimpleTextFormatMessageHandlerthat throws an exception in case of aerrormessageand collects and logs other messages.
-
ofThrowErrorsNoLogging
- Returns:
- a
SimpleTextFormatMessageHandlerthat throws an exception in case of aerrormessageand collects other messages without any logging.
-