This class implements LoggerPattern functionality.
The pattern defines fields to be substituted with real values
The pattern format is:
%[<modifiers>] <word> [{<option>}]
modifiers := [0-9.-]*
word := [a-zA-Z]+
option := [^}]*
When a word (i.e. longer than one char) key without curly brackets is not found then in the next step is resolved its first char, e.g. "%parchive"
the first step tries to resolve "parchive"
key and if not resolved the second step "p"
key. To parse in key if single step delimit a word from the next character, use curly brackets, i.e. empty option, e.g. "%p{}archive"
. If a key is not resolved then exception is raised.
The following table covers various modifiers and scenarios:
Format modifier | Left justify | Minimum width | Maximum width | Comment |
%20c | false | 20 | none | Left pad with spaces if the category name is less than 20 characters long |
%-20c | true | 20 | none | Right pad with spaces if the category name is less than 20 characters long |
%.30c | NA | none | 30 | Truncate from the beginning if the category name is longer than 30 characters |
%20.30c | false | 20 | 30 | Left pad with spaces if the category name is shorter than 20 characters. However, if the category name is longer than 30 characters, then truncate from the beginning |
%-20.30c | true | 20 | 30 | Right pad with spaces if the category name is shorter than 20 characters. However, if the category name is longer than 30 characters, then truncate from the beginning |
- Since
- Qore 2.0