Added logger ctor that accepts only name(empty logger)

This commit is contained in:
gabime 2019-06-01 14:57:57 +03:00
parent abd6a6784e
commit 52b6be0dfe

View File

@ -31,19 +31,30 @@ namespace spdlog {
class logger
{
public:
// Empty logger
logger(std::string name) :
name_(std::move(name)),
sinks_(){}
// Logger with range on sinks
template<typename It>
logger(std::string name, It begin, It end)
: name_(std::move(name))
, sinks_(begin, end)
{}
// Logger with single sink
logger(std::string name, sink_ptr single_sink)
: logger(std::move(name), {std::move(single_sink)})
{}
// Logger with sinks init list
logger(std::string name, sinks_init_list sinks)
: logger(std::move(name), sinks.begin(), sinks.end())
{}
virtual ~logger() = default;
logger(const logger &) = delete;