Commit f14d1c00 authored by gabime's avatar gabime

astyle

parent 0cfdad4d
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
namespace spdlog namespace spdlog
{ {
namespace sinks namespace sinks
{ {
template <class Mutex> template <class Mutex>
class stdout_sink: public base_sink<Mutex> class stdout_sink: public base_sink<Mutex>
{ {
using MyType = stdout_sink<Mutex>; using MyType = stdout_sink<Mutex>;
public: public:
stdout_sink() stdout_sink()
{} {}
static std::shared_ptr<MyType> instance() static std::shared_ptr<MyType> instance()
...@@ -40,17 +40,17 @@ namespace spdlog ...@@ -40,17 +40,17 @@ namespace spdlog
{ {
fflush(stdout); fflush(stdout);
} }
}; };
typedef stdout_sink<details::null_mutex> stdout_sink_st; typedef stdout_sink<details::null_mutex> stdout_sink_st;
typedef stdout_sink<std::mutex> stdout_sink_mt; typedef stdout_sink<std::mutex> stdout_sink_mt;
template <class Mutex> template <class Mutex>
class stderr_sink: public base_sink<Mutex> class stderr_sink: public base_sink<Mutex>
{ {
using MyType = stderr_sink<Mutex>; using MyType = stderr_sink<Mutex>;
public: public:
stderr_sink() stderr_sink()
{} {}
static std::shared_ptr<MyType> instance() static std::shared_ptr<MyType> instance()
...@@ -69,9 +69,9 @@ namespace spdlog ...@@ -69,9 +69,9 @@ namespace spdlog
{ {
fflush(stderr); fflush(stderr);
} }
}; };
typedef stderr_sink<std::mutex> stderr_sink_mt; typedef stderr_sink<std::mutex> stderr_sink_mt;
typedef stderr_sink<details::null_mutex> stderr_sink_st; typedef stderr_sink<details::null_mutex> stderr_sink_st;
} }
} }
...@@ -16,15 +16,15 @@ ...@@ -16,15 +16,15 @@
namespace spdlog namespace spdlog
{ {
namespace sinks namespace sinks
{ {
/* /*
* Windows color console sink. Uses WriteConsoleA to write to the console with colors * Windows color console sink. Uses WriteConsoleA to write to the console with colors
*/ */
template<class Mutex> template<class Mutex>
class wincolor_sink: public base_sink<Mutex> class wincolor_sink: public base_sink<Mutex>
{ {
public: public:
const WORD BOLD = FOREGROUND_INTENSITY; const WORD BOLD = FOREGROUND_INTENSITY;
const WORD RED = FOREGROUND_RED; const WORD RED = FOREGROUND_RED;
const WORD CYAN = FOREGROUND_GREEN | FOREGROUND_BLUE; const WORD CYAN = FOREGROUND_GREEN | FOREGROUND_BLUE;
...@@ -70,7 +70,7 @@ namespace spdlog ...@@ -70,7 +70,7 @@ namespace spdlog
colors_[level] = color; colors_[level] = color;
} }
private: private:
HANDLE out_handle_; HANDLE out_handle_;
std::map<level::level_enum, WORD> colors_; std::map<level::level_enum, WORD> colors_;
...@@ -82,35 +82,35 @@ namespace spdlog ...@@ -82,35 +82,35 @@ namespace spdlog
SetConsoleTextAttribute(out_handle_, attribs); SetConsoleTextAttribute(out_handle_, attribs);
return orig_buffer_info.wAttributes; //return orig attribs return orig_buffer_info.wAttributes; //return orig attribs
} }
}; };
// //
// windows color console to stdout // windows color console to stdout
// //
template<class Mutex> template<class Mutex>
class wincolor_stdout_sink: public wincolor_sink<Mutex> class wincolor_stdout_sink: public wincolor_sink<Mutex>
{ {
public: public:
wincolor_stdout_sink():wincolor_sink(GetStdHandle(STD_OUTPUT_HANDLE)) wincolor_stdout_sink():wincolor_sink(GetStdHandle(STD_OUTPUT_HANDLE))
{} {}
}; };
typedef wincolor_stdout_sink<std::mutex> wincolor_stdout_sink_mt; 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<details::null_mutex> wincolor_stdout_sink_st;
// //
// windows color console to stderr // windows color console to stderr
// //
template<class Mutex> template<class Mutex>
class wincolor_stderr_sink: public wincolor_sink<Mutex> class wincolor_stderr_sink: public wincolor_sink<Mutex>
{ {
public: public:
wincolor_stderr_sink():wincolor_sink(GetStdHandle(STD_ERROR_HANDLE)) wincolor_stderr_sink():wincolor_sink(GetStdHandle(STD_ERROR_HANDLE))
{} {}
}; };
typedef wincolor_stderr_sink<std::mutex> wincolor_stderr_sink_mt; 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<details::null_mutex> wincolor_stderr_sink_st;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment