diff options
author | gabime <gmelman1@gmail.com> | 2019-06-03 23:56:18 +0300 |
---|---|---|
committer | gabime <gmelman1@gmail.com> | 2019-06-03 23:56:18 +0300 |
commit | eea9d6136f78ed69139a68439983cd00d16b58dd (patch) | |
tree | a34a8ff678e4328590c9b148b55b79604aa2c726 /include/spdlog/spdlog.h | |
parent | c35f33e61afc487e99dd76d7b349b134b873ad18 (diff) |
Moved default sync factory to seperate file to avoid cyclic includes
Diffstat (limited to 'include/spdlog/spdlog.h')
-rw-r--r-- | include/spdlog/spdlog.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 56a69e4c..ce32bc6e 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -13,6 +13,7 @@ #include "spdlog/details/registry.h" #include "spdlog/logger.h" #include "spdlog/version.h" +#include "spdlog/details/synchronous_factory.h" #include <chrono> #include <functional> @@ -21,19 +22,6 @@ namespace spdlog { -// Default logger factory- creates synchronous loggers -struct synchronous_factory -{ - template<typename Sink, typename... SinkArgs> - static std::shared_ptr<spdlog::logger> create(std::string logger_name, SinkArgs &&... args) - { - auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(args)...); - auto new_logger = std::make_shared<logger>(std::move(logger_name), std::move(sink)); - details::registry::instance().initialize_logger(new_logger); - return new_logger; - } -}; - using default_factory = synchronous_factory; // Create and register a logger with a templated sink type |