Function clone

Synopsis

#include <include/spdlog/logger.h>

std::shared_ptr< logger > clone(std::string logger_name)

Description

create new logger with same sinks and configuration.

Source

Lines 158-163 in include/spdlog/logger-inl.h. Line 318 in include/spdlog/logger.h.

SPDLOG_INLINE std::shared_ptr<logger> logger::clone(std::string logger_name)
{
    auto cloned = std::make_shared<logger>(*this);
    cloned->name_ = std::move(logger_name);
    return cloned;
}





Add Discussion

Log in to comment