You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%8l requires right alignment and will expand to info;
%-8l requires left alignment and will expand to info ;
%=8l requires center alignment and will expand to info .
Besides, an additional ! can be used to truncate the expanded result if it's too wide:
%3!l, %-3!l, and %=3!l will expand to inf.
This feature can be neat sometimes and maybe we could also support this. We may follow the convention of format! and propose the following new pattern placeholder syntax:
placeholder := '{' NAME [ ':' format_spec ] '}'
format_spec := [ [fill] align ] [ ['.'] width ]
fill := CHAR
align := INT
width := INT
Some examples:
{level:8} and {level:<8} will expand to info (left alignment, pad with spaces);
{level:-<8} will expand to info---- (left alignment, pad with -);
{level:>8} will expand to info (right alignment, pad with spaces);
{level:->8} will expand to ----info (right alignment, pad with -);
{level:^8} will expand to info (center alignment, pad with spaces);
{level:-^8} will expand to --info-- (center alignment, pad with -);
{level:.3} will expand to inf (left alignment, truncate field to 3 characters long).
The text was updated successfully, but these errors were encountered:
spdlog
supports specifying text alignment in its pattern flags, see https://github.com/gabime/spdlog/wiki/3.-Custom-formatting#aligning:%8l
requires right alignment and will expand toinfo
;%-8l
requires left alignment and will expand toinfo
;%=8l
requires center alignment and will expand toinfo
.Besides, an additional
!
can be used to truncate the expanded result if it's too wide:%3!l
,%-3!l
, and%=3!l
will expand toinf
.This feature can be neat sometimes and maybe we could also support this. We may follow the convention of
format!
and propose the following new pattern placeholder syntax:Some examples:
{level:8}
and{level:<8}
will expand toinfo
(left alignment, pad with spaces);{level:-<8}
will expand toinfo----
(left alignment, pad with-
);{level:>8}
will expand toinfo
(right alignment, pad with spaces);{level:->8}
will expand to----info
(right alignment, pad with-
);{level:^8}
will expand toinfo
(center alignment, pad with spaces);{level:-^8}
will expand to--info--
(center alignment, pad with-
);{level:.3}
will expand toinf
(left alignment, truncate field to 3 characters long).The text was updated successfully, but these errors were encountered: