Skip to content

Custom flag aligning (padding) #2398

Answered by tt4g
agil899 asked this question in Q&A
Jun 8, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Adding padding seems to be the role of the formatter.
As far as I can tell from the source of the short_level_formatter, it passes padding_info to ScopedPadder to add padding.
The ScopedPadder is passed as a template argument, either scoped_padder or null_scoped_padder.

// short log level appender
template<typename ScopedPadder>
class short_level_formatter final : public flag_formatter
{
public:
explicit short_level_formatter(padding_info padinfo)
: flag_formatter(padinfo)
{}
void format(const details::log_msg &msg, const std::tm &, memory_buf_t &dest) override

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@agil899
Comment options

Answer selected by agil899
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants