-
Notifications
You must be signed in to change notification settings - Fork 7
Description
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?