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