This commit is contained in:
gabime 2016-10-12 23:08:44 +03:00
parent 0cfdad4d0b
commit f14d1c002b
11 changed files with 236 additions and 236 deletions

View File

@ -14,14 +14,14 @@
namespace spdlog
{
namespace sinks
{
namespace sinks
{
template <class Mutex>
class stdout_sink: public base_sink<Mutex>
{
template <class Mutex>
class stdout_sink: public base_sink<Mutex>
{
using MyType = stdout_sink<Mutex>;
public:
public:
stdout_sink()
{}
static std::shared_ptr<MyType> instance()
@ -40,17 +40,17 @@ namespace spdlog
{
fflush(stdout);
}
};
};
typedef stdout_sink<details::null_mutex> stdout_sink_st;
typedef stdout_sink<std::mutex> stdout_sink_mt;
typedef stdout_sink<details::null_mutex> stdout_sink_st;
typedef stdout_sink<std::mutex> stdout_sink_mt;
template <class Mutex>
class stderr_sink: public base_sink<Mutex>
{
template <class Mutex>
class stderr_sink: public base_sink<Mutex>
{
using MyType = stderr_sink<Mutex>;
public:
public:
stderr_sink()
{}
static std::shared_ptr<MyType> instance()
@ -69,9 +69,9 @@ namespace spdlog
{
fflush(stderr);
}
};
};
typedef stderr_sink<std::mutex> stderr_sink_mt;
typedef stderr_sink<details::null_mutex> stderr_sink_st;
}
typedef stderr_sink<std::mutex> stderr_sink_mt;
typedef stderr_sink<details::null_mutex> stderr_sink_st;
}
}

View File

@ -16,15 +16,15 @@
namespace spdlog
{
namespace sinks
{
/*
namespace sinks
{
/*
* Windows color console sink. Uses WriteConsoleA to write to the console with colors
*/
template<class Mutex>
class wincolor_sink: public base_sink<Mutex>
{
public:
template<class Mutex>
class wincolor_sink: public base_sink<Mutex>
{
public:
const WORD BOLD = FOREGROUND_INTENSITY;
const WORD RED = FOREGROUND_RED;
const WORD CYAN = FOREGROUND_GREEN | FOREGROUND_BLUE;
@ -70,7 +70,7 @@ namespace spdlog
colors_[level] = color;
}
private:
private:
HANDLE out_handle_;
std::map<level::level_enum, WORD> colors_;
@ -82,35 +82,35 @@ namespace spdlog
SetConsoleTextAttribute(out_handle_, attribs);
return orig_buffer_info.wAttributes; //return orig attribs
}
};
};
//
// windows color console to stdout
//
template<class Mutex>
class wincolor_stdout_sink: public wincolor_sink<Mutex>
{
public:
//
// windows color console to stdout
//
template<class Mutex>
class wincolor_stdout_sink: public wincolor_sink<Mutex>
{
public:
wincolor_stdout_sink():wincolor_sink(GetStdHandle(STD_OUTPUT_HANDLE))
{}
};
};
typedef wincolor_stdout_sink<std::mutex> wincolor_stdout_sink_mt;
typedef wincolor_stdout_sink<details::null_mutex> wincolor_stdout_sink_st;
typedef wincolor_stdout_sink<std::mutex> wincolor_stdout_sink_mt;
typedef wincolor_stdout_sink<details::null_mutex> wincolor_stdout_sink_st;
//
// windows color console to stderr
//
template<class Mutex>
class wincolor_stderr_sink: public wincolor_sink<Mutex>
{
public:
//
// windows color console to stderr
//
template<class Mutex>
class wincolor_stderr_sink: public wincolor_sink<Mutex>
{
public:
wincolor_stderr_sink():wincolor_sink(GetStdHandle(STD_ERROR_HANDLE))
{}
};
};
typedef wincolor_stderr_sink<std::mutex> wincolor_stderr_sink_mt;
typedef wincolor_stderr_sink<details::null_mutex> wincolor_stderr_sink_st;
typedef wincolor_stderr_sink<std::mutex> wincolor_stderr_sink_mt;
typedef wincolor_stderr_sink<details::null_mutex> wincolor_stderr_sink_st;
}
}
}