Function initialize_logger

Synopsis

#include <include/spdlog/spdlog.h>

SPDLOG_INLINE void initialize_logger(std::shared_ptr< logger > logger)

Description

Initialize and register a logger, formatter and flush level will be set according the global settings.

Useful for initializing manually created loggers with the global settings.

Example: auto mylogger = std::make_shared<spdlog::logger>("mylogger", ...); spdlog::initialize_logger(mylogger);

Source

Lines 15-18 in include/spdlog/spdlog-inl.h. Line 47 in include/spdlog/spdlog.h.

SPDLOG_INLINE void initialize_logger(std::shared_ptr<logger> logger)
{
    details::registry::instance().initialize_logger(std::move(logger));
}





Add Discussion

Log in to comment