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 | #ifdef _WIN32 |
7 | # include <spdlog/sinks/wincolor_sink.h> |
8 | #else |
9 | # include <spdlog/sinks/ansicolor_sink.h> |
10 | #endif |
11 | |
12 | #include <spdlog/details/synchronous_factory.h> |
13 | |
14 | namespace spdlog { |
15 | namespace sinks { |
16 | #ifdef _WIN32 |
17 | using stdout_color_sink_mt = wincolor_stdout_sink_mt; |
18 | using stdout_color_sink_st = wincolor_stdout_sink_st; |
19 | using stderr_color_sink_mt = wincolor_stderr_sink_mt; |
20 | using stderr_color_sink_st = wincolor_stderr_sink_st; |
21 | #else |
22 | using stdout_color_sink_mt = ansicolor_stdout_sink_mt; |
23 | using stdout_color_sink_st = ansicolor_stdout_sink_st; |
24 | using stderr_color_sink_mt = ansicolor_stderr_sink_mt; |
25 | using stderr_color_sink_st = ansicolor_stderr_sink_st; |
26 | #endif |
27 | } // namespace sinks |
28 | |
29 | template<typename Factory = spdlog::synchronous_factory> |
30 | std::shared_ptr<logger> stdout_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic); |
31 | |
32 | template<typename Factory = spdlog::synchronous_factory> |
33 | std::shared_ptr<logger> stdout_color_st(const std::string &logger_name, color_mode mode = color_mode::automatic); |
34 | |
35 | template<typename Factory = spdlog::synchronous_factory> |
36 | std::shared_ptr<logger> stderr_color_mt(const std::string &logger_name, color_mode mode = color_mode::automatic); |
37 | |
38 | template<typename Factory = spdlog::synchronous_factory> |
39 | std::shared_ptr<logger> stderr_color_st(const std::string &logger_name, color_mode mode = color_mode::automatic); |
40 | |
41 | } // namespace spdlog |
42 | |
43 | #ifdef SPDLOG_HEADER_ONLY |
44 | # include "stdout_color_sinks-inl.h" |
45 | #endif |
46 | |