Renamed traits to console globals
This commit is contained in:
parent
39c6eb752a
commit
bde4c7149f
@ -7,7 +7,7 @@
|
||||
#include "stdio.h"
|
||||
namespace spdlog {
|
||||
namespace details {
|
||||
struct console_stdout_trait
|
||||
struct console_stdout_stream
|
||||
{
|
||||
static FILE *stream()
|
||||
{
|
||||
@ -21,7 +21,7 @@ struct console_stdout_trait
|
||||
#endif
|
||||
};
|
||||
|
||||
struct console_stderr_trait
|
||||
struct console_stderr_stream
|
||||
{
|
||||
static FILE *stream()
|
||||
{
|
||||
@ -35,7 +35,7 @@ struct console_stderr_trait
|
||||
#endif
|
||||
};
|
||||
|
||||
struct console_mutex_trait
|
||||
struct console_global_mutex
|
||||
{
|
||||
using mutex_t = std::mutex;
|
||||
static mutex_t &console_mutex()
|
||||
@ -45,7 +45,7 @@ struct console_mutex_trait
|
||||
}
|
||||
};
|
||||
|
||||
struct console_null_mutex_trait
|
||||
struct console_global_nullmutex
|
||||
{
|
||||
using mutex_t = null_mutex;
|
||||
static mutex_t &console_mutex()
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/details/os.h"
|
||||
#include "spdlog/details/traits.h"
|
||||
#include "spdlog/details/console_globals.h"
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@ -132,10 +132,11 @@ private:
|
||||
std::unordered_map<level::level_enum, std::string, level::level_hasher> colors_;
|
||||
};
|
||||
|
||||
using ansicolor_stdout_sink_mt = ansicolor_sink<details::console_stdout_trait, details::console_mutex_trait>;
|
||||
using ansicolor_stdout_sink_st = ansicolor_sink<details::console_stdout_trait, details::console_null_mutex_trait>;
|
||||
using ansicolor_stderr_sink_mt = ansicolor_sink<details::console_stderr_trait, details::console_mutex_trait>;
|
||||
using ansicolor_stderr_sink_st = ansicolor_sink<details::console_stderr_trait, details::console_null_mutex_trait>;
|
||||
using ansicolor_stdout_sink_mt = ansicolor_sink<details::console_stdout_stream, details::console_global_mutex>;
|
||||
using ansicolor_stdout_sink_st = ansicolor_sink<details::console_stdout_stream, details::console_global_nullmutex>;
|
||||
|
||||
using ansicolor_stderr_sink_mt = ansicolor_sink<details::console_stderr_stream, details::console_global_mutex>;
|
||||
using ansicolor_stderr_sink_st = ansicolor_sink<details::console_stderr_stream, details::console_global_nullmutex>;
|
||||
|
||||
} // namespace sinks
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "../fmt/fmt.h"
|
||||
#include "spdlog/common.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/details/traits.h"
|
||||
#include "spdlog/details/console_globals.h"
|
||||
#include "spdlog/sinks/sink.h"
|
||||
|
||||
#include <memory>
|
||||
@ -116,11 +116,11 @@ private:
|
||||
std::unordered_map<level::level_enum, WORD, level::level_hasher> colors_;
|
||||
};
|
||||
|
||||
using wincolor_stdout_sink_mt = wincolor_sink<details::console_stdout_trait, details::console_mutex_trait>;
|
||||
using wincolor_stdout_sink_st = wincolor_sink<details::console_stdout_trait, details::console_null_mutex_trait>;
|
||||
using wincolor_stdout_sink_mt = wincolor_sink<details::console_stdout_stream, details::console_global_mutex>;
|
||||
using wincolor_stdout_sink_st = wincolor_sink<details::console_stdout_stream, details::console_global_nullmutex>;
|
||||
|
||||
using wincolor_stderr_sink_mt = wincolor_sink<details::console_stderr_trait, details::console_mutex_trait>;
|
||||
using wincolor_stderr_sink_st = wincolor_sink<details::console_stderr_trait, details::console_null_mutex_trait>;
|
||||
using wincolor_stderr_sink_mt = wincolor_sink<details::console_stderr_stream, details::console_global_mutex>;
|
||||
using wincolor_stderr_sink_st = wincolor_sink<details::console_stderr_stream, details::console_global_nullmutex>;
|
||||
|
||||
} // namespace sinks
|
||||
} // namespace spdlog
|
||||
|
Loading…
Reference in New Issue
Block a user