logpp icon indicating copy to clipboard operation
logpp copied to clipboard

Support padding specification in PatternFormatter

Open oktal opened this issue 5 years ago • 0 comments

PatternFormatter should allow to specifiy padding.

For example, the given flag %-5l should right pad the level less than 5 characters long.

Reference of padding specifications that should be supported

Format modifier left justify minimum width maximum width comment
%20n false 20 none Left pad with spaces if the logger name is less than 20 characters long.
%-20n true 20 none Right pad with spaces if the logger name is less than 20 characters long.
%.30n NA none 30 Truncate from the beginning if the logger name is longer than 30 characters.
%20.30n false 20 30 Left pad with spaces if the logger name is shorter than 20 characters. However, if logger name is longer than 30 characters, then truncate from the beginning.
%-20.30n true 20 30 Right pad with spaces if the logger name is shorter than 20 characters. However, if logger name is longer than 30 characters, then truncate from the beginning.

oktal avatar Jan 09 '21 10:01 oktal