Function create


#include <include/spdlog/spdlog.h>

template <typename Sink, typename... SinkArgs>
std::shared_ptr< spdlog::logger > create(std::string logger_name, SinkArgs &&...sink_args)


Create and register a logger with a templated sink type The logger's level, formatter and flush level will be set according the global settings.

Example: spdlog::create<daily_file_sink_st>("logger_name", "dailylog_filename", 11, 59);

Mentioned in


Lines 33-37 in include/spdlog/spdlog.h.

template<typename Sink, typename... SinkArgs>
inline std::shared_ptr<spdlog::logger> create(std::string logger_name, SinkArgs &&...sink_args)
    return default_factory::create<Sink>(std::move(logger_name), std::forward<SinkArgs>(sink_args)...);

Add Discussion

Log in to comment