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

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

@ -76,7 +76,7 @@ protected:
void set_pattern_(const std::string &pattern) override 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 void set_formatter_(std::unique_ptr<spdlog::formatter> sink_formatter) override

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

@ -330,7 +330,7 @@ public:
std::unique_ptr<custom_flag_formatter> clone() const override 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 // test clone with custom flag formatters

Loading…
Cancel
Save