Unverified Commit c4438966 authored by Gabi Melman's avatar Gabi Melman Committed by GitHub

Merge pull request #986 from DanielChabrowski/sink-allow-custom-formatter

Allow custom formatter in sink's ctor
parents c5552dac 79f11bd6
......@@ -14,15 +14,10 @@ namespace sinks {
class sink
{
public:
sink()
: level_(level::trace)
, formatter_(new pattern_formatter())
{
}
sink() = default;
explicit sink(std::unique_ptr<spdlog::pattern_formatter> formatter)
: level_(level::trace)
, formatter_(std::move(formatter))
explicit sink(std::unique_ptr<spdlog::formatter> formatter)
: formatter_{std::move(formatter)}
{
}
......@@ -49,10 +44,10 @@ public:
protected:
// sink log level - default is all
level_t level_;
level_t level_{level::trace};
// sink formatter - default is full format
std::unique_ptr<spdlog::formatter> formatter_;
std::unique_ptr<spdlog::formatter> formatter_{details::make_unique<spdlog::pattern_formatter>()};
};
} // namespace sinks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment