From 789fb1e7c9d850f237aae805d70168d090932dd5 Mon Sep 17 00:00:00 2001 From: k0zmo Date: Sat, 13 Jul 2019 10:54:22 +0200 Subject: [PATCH 1/3] Move templated constructor definition to header file --- include/spdlog/async_logger-inl.h | 8 -------- include/spdlog/async_logger.h | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/spdlog/async_logger-inl.h b/include/spdlog/async_logger-inl.h index 159e171e..6a945a2f 100644 --- a/include/spdlog/async_logger-inl.h +++ b/include/spdlog/async_logger-inl.h @@ -14,14 +14,6 @@ #include #include -template -SPDLOG_INLINE spdlog::async_logger::async_logger( - std::string logger_name, It begin, It end, std::weak_ptr tp, async_overflow_policy overflow_policy) - : logger(std::move(logger_name), begin, end) - , thread_pool_(std::move(tp)) - , overflow_policy_(overflow_policy) -{} - SPDLOG_INLINE spdlog::async_logger::async_logger( std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp, async_overflow_policy overflow_policy) : async_logger(std::move(logger_name), sinks_list.begin(), sinks_list.end(), std::move(tp), overflow_policy) diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h index c6309360..9899837b 100644 --- a/include/spdlog/async_logger.h +++ b/include/spdlog/async_logger.h @@ -37,7 +37,11 @@ class async_logger final : public std::enable_shared_from_this, pu public: template async_logger(std::string logger_name, It begin, It end, std::weak_ptr tp, - async_overflow_policy overflow_policy = async_overflow_policy::block); + async_overflow_policy overflow_policy = async_overflow_policy::block) + : logger(std::move(logger_name), begin, end) + , thread_pool_(std::move(tp)) + , overflow_policy_(overflow_policy) + {} async_logger(std::string logger_name, sinks_init_list sinks_list, std::weak_ptr tp, async_overflow_policy overflow_policy = async_overflow_policy::block); From ddb19f4a4f6a10401be02b65eec13e8718c54f55 Mon Sep 17 00:00:00 2001 From: k0zmo Date: Sat, 13 Jul 2019 10:55:17 +0200 Subject: [PATCH 2/3] Add missing include directive --- include/spdlog/sinks/stdout_sinks-inl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/spdlog/sinks/stdout_sinks-inl.h b/include/spdlog/sinks/stdout_sinks-inl.h index e9fccd37..dc2728c8 100644 --- a/include/spdlog/sinks/stdout_sinks-inl.h +++ b/include/spdlog/sinks/stdout_sinks-inl.h @@ -4,6 +4,7 @@ #pragma once #include "spdlog/details/console_globals.h" +#include "spdlog/details/pattern_formatter.h" #include namespace spdlog { From 29fa474e4a48ac0d8864ef35bef8624046852715 Mon Sep 17 00:00:00 2001 From: k0zmo Date: Sat, 13 Jul 2019 10:56:22 +0200 Subject: [PATCH 3/3] Use SPDLOG_HEADER_ONLY uniformly --- include/spdlog/sinks/base_sink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdlog/sinks/base_sink.h b/include/spdlog/sinks/base_sink.h index 4ca51c75..be3956a7 100644 --- a/include/spdlog/sinks/base_sink.h +++ b/include/spdlog/sinks/base_sink.h @@ -41,6 +41,6 @@ protected: } // namespace sinks } // namespace spdlog -#ifndef SPDLOG_COMPILED_LIB +#ifdef SPDLOG_HEADER_ONLY #include "base_sink-inl.h" #endif