Create a new MessageFormatter instance with the given template string.
the template string to use for formatting messages.
StaticusingSet up a MessageFormatter with a given template string.
the template string to use for formatting messages.
the MessageFormatter instance for chaining.
MessageFormatter class is responsible for formatting strings based on a template string and a data object. The template can contain placeholders in the format {key} which will be replaced by corresponding values from the data object. It also supports optional blocks in the format [? ... ] which will only be included in the final message if all placeholders within them have corresponding data values. This allows for flexible and dynamic log message formatting based on the available data.