// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #pragma once #ifndef SPDLOG_HEADER_ONLY #include #endif #include #include #include #include template SPDLOG_INLINE spdlog::sinks::base_sink::base_sink() : formatter_{details::make_unique()} {} template SPDLOG_INLINE spdlog::sinks::base_sink::base_sink( std::unique_ptr formatter) : formatter_{std::move(formatter)} {} 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() { std::lock_guard lock(mutex_); flush_(); } 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) { 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) { set_formatter_(details::make_unique(pattern)); } template void SPDLOG_INLINE spdlog::sinks::base_sink::set_formatter_(std::unique_ptr sink_formatter) { formatter_ = std::move(sink_formatter); }