Package org.apache.commons.jcs3.log
Class MessageFormatter
java.lang.Object
org.apache.commons.jcs3.log.MessageFormatter
Handles messages that consist of a format string conforming to
java.text.MessageFormat. (Borrowed from log4j2)
-
Constructor Summary
ConstructorsConstructorDescriptionMessageFormatter
(String messagePattern, Object... parameters) Constructs a message formatter.MessageFormatter
(String messagePattern, Supplier<?>... paramSuppliers) Constructs a message formatter. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
formatMessage
(String msgPattern, Object... args) Returns the formatted message.Return the throwable passed to the Message.boolean
Return true, if the parameters list contains a Throwable.toString()
-
Constructor Details
-
MessageFormatter
Constructs a message formatter.- Parameters:
messagePattern
- the pattern for this message formatparameters
- The objects to format
-
MessageFormatter
Constructs a message formatter.- Parameters:
messagePattern
- the pattern for this message formatparamSuppliers
- An array of functions, which when called, produce the desired log message parameters.
-
-
Method Details
-
getFormattedMessage
Returns the formatted message.- Returns:
- the formatted message.
-
formatMessage
-
toString
-
getThrowable
Return the throwable passed to the Message.- Returns:
- the Throwable.
-
hasThrowable
Return true, if the parameters list contains a Throwable.- Returns:
- true, if the parameters list contains a Throwable.
-