public class MessageFormatter extends Object
Constructor and Description |
---|
MessageFormatter(String messagePattern,
Object... parameters)
Constructs a message formatter.
|
MessageFormatter(String messagePattern,
Supplier<?>... paramSuppliers)
Constructs a message formatter.
|
Modifier and Type | Method and Description |
---|---|
protected String |
formatMessage(String msgPattern,
Object... args) |
String |
getFormattedMessage()
Returns the formatted message.
|
Throwable |
getThrowable()
Return the throwable passed to the Message.
|
boolean |
hasThrowable()
Return true, if the parameters list contains a Throwable.
|
String |
toString() |
public MessageFormatter(String messagePattern, Object... parameters)
messagePattern
- the pattern for this message formatparameters
- The objects to formatpublic MessageFormatter(String messagePattern, Supplier<?>... paramSuppliers)
messagePattern
- the pattern for this message formatparamSuppliers
- An array of functions, which when called, produce the desired
log message parameters.public String getFormattedMessage()
protected String formatMessage(String msgPattern, Object... args)
public Throwable getThrowable()
public boolean hasThrowable()
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.