| 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, |
| 31 | color_mode mode = color_mode::automatic); |
| 32 | |
| 33 | template <typename Factory = spdlog::synchronous_factory> |
| 34 | std::shared_ptr<logger> stdout_color_st(const std::string &logger_name, |
| 35 | color_mode mode = color_mode::automatic); |
| 36 | |
| 37 | template <typename Factory = spdlog::synchronous_factory> |
| 38 | std::shared_ptr<logger> stderr_color_mt(const std::string &logger_name, |
| 39 | color_mode mode = color_mode::automatic); |
| 40 | |
| 41 | template <typename Factory = spdlog::synchronous_factory> |
| 42 | std::shared_ptr<logger> stderr_color_st(const std::string &logger_name, |
| 43 | color_mode mode = color_mode::automatic); |
| 44 | |
| 45 | } // namespace spdlog |
| 46 | |
| 47 | #ifdef SPDLOG_HEADER_ONLY |
| 48 | #include "stdout_color_sinks-inl.h" |
| 49 | #endif |
| 50 |