Added padding support and set_pattern to custom_flags

This commit is contained in:
Gabi Melman
2020-03-21 15:03:41 +02:00
parent d1a1024465
commit 60a8c5f1c9
4 changed files with 70 additions and 28 deletions

View File

@@ -276,8 +276,8 @@ public:
void custom_flags_example()
{
using spdlog::details::make_unique; //for pre c++14
auto formatter = make_unique<spdlog::pattern_formatter>("[%+] [%*]");
formatter->add_flag<my_formatter_flag>('*').recompile();
using spdlog::details::make_unique; // for pre c++14
auto formatter = make_unique<spdlog::pattern_formatter>();
formatter->add_flag<my_formatter_flag>('*').set_pattern("[%n] [%*] [%^%l%$] %v");
spdlog::set_formatter(std::move(formatter));
}