pull/1884/head
gabime 5 years ago
parent fe734a3072
commit 5f20d5321d

@ -4,13 +4,13 @@
//
#include "benchmark/benchmark.h"
#include "spdlog/spdlog.h"
#include "spdlog/pattern_formatter.h"
#include <memory>
void bench_formatter(benchmark::State &state, std::string pattern)
{
auto formatter = spdlog::details::make_unique<spdlog::pattern_formatter>(pattern);
auto formatter = std::make_unique<spdlog::pattern_formatter>(pattern);
spdlog::memory_buf_t dest;
std::string logger_name = "logger-name";
const char *text = "Hello. This is some message with length of 80 ";

@ -275,7 +275,7 @@ public:
void custom_flags_example()
{
auto formatter = std::make_unique<spdlog::pattern_formatter>();
formatter->add_flag<my_formatter_flag>('*').set_pattern("[%n] [%*] [%^%l%$] %v");
spdlog::set_formatter(std::move(formatter));

@ -76,7 +76,7 @@ protected:
void set_pattern_(const std::string &pattern) override
{
set_formatter_(details::make_unique<spdlog::pattern_formatter>(pattern));
set_formatter_(std::make_unique<spdlog::pattern_formatter>(pattern));
}
void set_formatter_(std::unique_ptr<spdlog::formatter> sink_formatter) override

@ -11,6 +11,7 @@
#include <sstream>
#include <string>
#include <iomanip>
#include <memory>
#include <stdlib.h>
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG

@ -330,7 +330,7 @@ public:
std::unique_ptr<custom_flag_formatter> clone() const override
{
return spdlog::details::make_unique<custom_test_flag>(some_txt);
return std::make_unique<custom_test_flag>(some_txt);
}
};
// test clone with custom flag formatters

Loading…
Cancel
Save