mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 02:21:34 +08:00
Improved null_logger factory
This commit is contained in:
parent
f2f9f324ec
commit
45717147f7
@ -33,13 +33,17 @@ using null_sink_st = null_sink<details::null_mutex>;
|
|||||||
template<typename Factory = default_factory>
|
template<typename Factory = default_factory>
|
||||||
inline std::shared_ptr<logger> null_logger_mt(const std::string &logger_name)
|
inline std::shared_ptr<logger> null_logger_mt(const std::string &logger_name)
|
||||||
{
|
{
|
||||||
return Factory::template create<sinks::null_sink_mt>(logger_name);
|
auto null_logger = Factory::template create<sinks::null_sink_mt>(logger_name);
|
||||||
|
null_logger->set_level(level::off);
|
||||||
|
return null_logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Factory = default_factory>
|
template<typename Factory = default_factory>
|
||||||
inline std::shared_ptr<logger> null_logger_st(const std::string &logger_name)
|
inline std::shared_ptr<logger> null_logger_st(const std::string &logger_name)
|
||||||
{
|
{
|
||||||
return Factory::template create<sinks::null_sink_st>(logger_name);
|
auto null_logger = Factory::template create<sinks::null_sink_st>(logger_name);
|
||||||
|
null_logger->set_level(level::off);
|
||||||
|
return null_logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace spdlog
|
} // namespace spdlog
|
||||||
|
Loading…
Reference in New Issue
Block a user