Hi,
Something that sometimes would be useful, is bunt::format_args (and maybe bunt::format).
This would come in handy, for example, to format logging messages with bunt. In this case, a user can't currently use bunts macros without allocating. Another use-case would be to store formatted strings (probably only via bunt::format with an allocation).
The best option I could come up with is to write! to a termcolor::Buffer, but this does allocate.
(By the way, does bunt allocate internally?)
My current use case is, that I have a log macro that accepts a bunt format string and arguments (which prints regular status messages for the user). I also have an option to activate debugging output, which activates tracing.
So basically, there are two different log output formats (my own and tracing).
It would be better if – if debug is activated – my log macro redirects messages to tracing. But, as mentioned above, this is only possible via termcolor::Buffer to which I write bunts output.
How hard would it be to add a variant of std::format_args to bunt?
Hi,
Something that sometimes would be useful, is
bunt::format_args(and maybebunt::format).This would come in handy, for example, to format logging messages with
bunt. In this case, a user can't currently usebunts macros without allocating. Another use-case would be to store formatted strings (probably only viabunt::formatwith an allocation).The best option I could come up with is to
write!to atermcolor::Buffer, but this does allocate.(By the way, does
buntallocate internally?)My current use case is, that I have a
logmacro that accepts abuntformat string and arguments (which prints regular status messages for the user). I also have an option to activate debugging output, which activates tracing.So basically, there are two different log output formats (my own and
tracing).It would be better if – if
debugis activated – mylogmacro redirects messages totracing. But, as mentioned above, this is only possible viatermcolor::Bufferto which I writebunts output.How hard would it be to add a variant of std::format_args to
bunt?