Commit 52b6be0d authored by gabime's avatar gabime

Added logger ctor that accepts only name(empty logger)

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