|
|
|
@ -34,7 +34,7 @@
|
|
|
|
|
|
|
|
|
|
inline void spdlog::register_logger(std::shared_ptr<logger> logger)
|
|
|
|
|
{
|
|
|
|
|
return details::registry::instance().register_logger(logger);
|
|
|
|
|
return details::registry::instance().register_logger(std::move(logger));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline std::shared_ptr<spdlog::logger> spdlog::get(const std::string& name)
|
|
|
|
@ -183,13 +183,11 @@ inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string& logger_
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Create logger with multiple sinks
|
|
|
|
|
|
|
|
|
|
inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string& logger_name, spdlog::sinks_init_list sinks)
|
|
|
|
|
{
|
|
|
|
|
return details::registry::instance().create(logger_name, sinks);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <typename Sink, typename... Args>
|
|
|
|
|
inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string& logger_name, Args... args)
|
|
|
|
|
{
|
|
|
|
@ -197,7 +195,6 @@ inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string& logger_
|
|
|
|
|
return details::registry::instance().create(logger_name, { sink });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class It>
|
|
|
|
|
inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string& logger_name, const It& sinks_begin, const It& sinks_end)
|
|
|
|
|
{
|
|
|
|
@ -224,7 +221,7 @@ inline std::shared_ptr<spdlog::logger> spdlog::create_async(const std::string& l
|
|
|
|
|
|
|
|
|
|
inline void spdlog::set_formatter(spdlog::formatter_ptr f)
|
|
|
|
|
{
|
|
|
|
|
details::registry::instance().formatter(f);
|
|
|
|
|
details::registry::instance().formatter(std::move(f));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline void spdlog::set_pattern(const std::string& format_string)
|
|
|
|
@ -244,10 +241,9 @@ inline void spdlog::flush_on(level::level_enum log_level)
|
|
|
|
|
|
|
|
|
|
inline void spdlog::set_error_handler(log_err_handler handler)
|
|
|
|
|
{
|
|
|
|
|
return details::registry::instance().set_error_handler(handler);
|
|
|
|
|
return details::registry::instance().set_error_handler(std::move(handler));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void spdlog::set_async_mode(size_t queue_size, const async_overflow_policy overflow_policy, const std::function<void()>& worker_warmup_cb, const std::chrono::milliseconds& flush_interval_ms, const std::function<void()>& worker_teardown_cb)
|
|
|
|
|
{
|
|
|
|
|
details::registry::instance().set_async_mode(queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms, worker_teardown_cb);
|
|
|
|
@ -260,7 +256,7 @@ inline void spdlog::set_sync_mode()
|
|
|
|
|
|
|
|
|
|
inline void spdlog::apply_all(std::function<void(std::shared_ptr<logger>)> fun)
|
|
|
|
|
{
|
|
|
|
|
details::registry::instance().apply_all(fun);
|
|
|
|
|
details::registry::instance().apply_all(std::move(fun));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline void spdlog::drop_all()
|
|
|
|
|