diff --git a/include/spdlog/details/spdlog_impl.h b/include/spdlog/details/spdlog_impl.h index 8337ab47..bfc56717 100644 --- a/include/spdlog/details/spdlog_impl.h +++ b/include/spdlog/details/spdlog_impl.h @@ -93,6 +93,11 @@ inline std::shared_ptr spdlog::syslog_logger(const std::string& } #endif +// Create and register a logger a single sink +inline std::shared_ptr spdlog::create(const std::string& logger_name, const spdlog::sink_ptr& sink) +{ + return details::registry::instance().create(logger_name, sink); +} //Create logger with multiple sinks diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 043e8141..62c81b56 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -91,6 +91,9 @@ std::shared_ptr syslog_logger(const std::string& logger_name, const std: #endif +// Create and register a logger a single sink +std::shared_ptr create(const std::string& logger_name, const sink_ptr& sink); + // Create and register a logger with multiple sinks std::shared_ptr create(const std::string& logger_name, sinks_init_list sinks); template