mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Added logger ctor that accepts only name(empty logger)
This commit is contained in:
parent
abd6a6784e
commit
52b6be0dfe
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user