Function get

Synopsis

#include <include/spdlog/spdlog.h>

std::shared_ptr< logger > get(const std::string &name)

Description

Return an existing logger or nullptr if a logger with such name doesn't exist. example: spdlog::get("my_logger")->info("hello {}", "world");

Mentioned in

Source

Lines 39-42 in include/spdlog/details/spdlog_impl.h. Line 24 in include/spdlog/spdlog.h.

inline std::shared_ptr<spdlog::logger> spdlog::get(const std::string &name)
{
    return details::registry::instance().get(name);
}





Add Discussion

Log in to comment