spdlog
Loading...
Searching...
No Matches
base_sink-inl.h
Go to the documentation of this file.
1// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
2// Distributed under the MIT License (http://opensource.org/licenses/MIT)
3
4#pragma once
5
6#ifndef SPDLOG_HEADER_ONLY
8#endif
9
10#include <spdlog/common.h>
12
13#include <memory>
14
15template<typename Mutex>
19
20template<typename Mutex>
22 : formatter_{std::move(formatter)}
23{}
24
25template<typename Mutex>
27{
28 std::lock_guard<Mutex> lock(mutex_);
29 sink_it_(msg);
30}
31
32template<typename Mutex>
36 flush_();
37}
38
39template<typename Mutex>
41{
42 std::lock_guard<Mutex> lock(mutex_);
43 set_pattern_(pattern);
46template<typename Mutex>
48{
49 std::lock_guard<Mutex> lock(mutex_);
50 set_formatter_(std::move(sink_formatter));
51}
52
53template<typename Mutex>
55{
56 set_formatter_(details::make_unique<spdlog::pattern_formatter>(pattern));
57}
58
59template<typename Mutex>
61{
62 formatter_ = std::move(sink_formatter);
63}
virtual void set_formatter_(std::unique_ptr< spdlog::formatter > sink_formatter)
void log(const details::log_msg &msg) final
void set_formatter(std::unique_ptr< spdlog::formatter > sink_formatter) final
void set_pattern(const std::string &pattern) final
virtual void set_pattern_(const std::string &pattern)
#define SPDLOG_INLINE
Definition common.h:33
Definition async.h:25