parsePrintfTerm

public int parsePrintfTerm(MessageBuilder<? extends Object> builder, int index, String message, int termStart, int specStart, int formatStart)

Parses a single printf-like term from a log message into a message template builder.

A simple example of an implicit parameter (the argument index is not specified):

message: "Hello %s World"
termStart: 6 ───┚╿╿
specStart: 7 ────┤│
formatStart: 7 ──╯│
return: 8 ────────╯
If this case there is no format specification, so specStart == formatStart.

A complex example with an explicit index:

message: "Hello %2$10d World"
termStart: 6 ───┚  ╿ ╿╿
specStart: 9 ──────╯ ││
formatStart: 11 ─────╯│
return: 12 ───────────╯
Note that in this example the given index will be 1 (rather than 2) because printf specifies indices using a 1-based scheme, but internally they are 0-based.

Return

the index after the last character of the term.

Parameters

builder

the message template builder.

index

the zero-based argument index for the parameter.

message

the complete log message string.

termStart

the index of the initial '%' character that starts the term.

specStart

the index of the first format specification character (after any optional index specification).

formatStart

the index of the (first) format character in the term.