diff --git a/include/spdlog/sinks/base_sink-inl.h b/include/spdlog/sinks/base_sink-inl.h index 421fdf9d..9cf961e1 100644 --- a/include/spdlog/sinks/base_sink-inl.h +++ b/include/spdlog/sinks/base_sink-inl.h @@ -4,60 +4,53 @@ #pragma once #ifndef SPDLOG_HEADER_ONLY -# include + #include #endif #include #include #include +#include -template +template SPDLOG_INLINE spdlog::sinks::base_sink::base_sink() - : formatter_{details::make_unique()} -{} + : formatter_{details::make_unique()} {} -template +template SPDLOG_INLINE spdlog::sinks::base_sink::base_sink(std::unique_ptr formatter) - : formatter_{std::move(formatter)} -{} + : formatter_{std::move(formatter)} {} -template -void SPDLOG_INLINE spdlog::sinks::base_sink::log(const details::log_msg &msg) -{ +template +void SPDLOG_INLINE spdlog::sinks::base_sink::log(const details::log_msg &msg) { std::lock_guard lock(mutex_); sink_it_(msg); } -template -void SPDLOG_INLINE spdlog::sinks::base_sink::flush() -{ +template +void SPDLOG_INLINE spdlog::sinks::base_sink::flush() { std::lock_guard lock(mutex_); flush_(); } -template -void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern(const std::string &pattern) -{ +template +void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern(const std::string &pattern) { std::lock_guard lock(mutex_); set_pattern_(pattern); } -template -void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter(std::unique_ptr sink_formatter) -{ +template +void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter(std::unique_ptr sink_formatter) { std::lock_guard lock(mutex_); set_formatter_(std::move(sink_formatter)); } -template -void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern_(const std::string &pattern) -{ +template +void SPDLOG_INLINE spdlog::sinks::base_sink::set_pattern_(const std::string &pattern) { set_formatter_(details::make_unique(pattern)); } -template -void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) -{ +template +void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) { formatter_ = std::move(sink_formatter); }