mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 11:29:01 +08:00
formatting
This commit is contained in:
@@ -19,7 +19,8 @@ namespace spdlog { namespace sinks {
|
||||
* of the message.
|
||||
* If no color terminal detected, omit the escape codes.
|
||||
*/
|
||||
template<class Mutex> class ansicolor_sink : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class ansicolor_sink : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
explicit ansicolor_sink(FILE *file)
|
||||
@@ -106,7 +107,8 @@ protected:
|
||||
std::unordered_map<level::level_enum, std::string, level::level_hasher> colors_;
|
||||
};
|
||||
|
||||
template<class Mutex> class ansicolor_stdout_sink : public ansicolor_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class ansicolor_stdout_sink : public ansicolor_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
ansicolor_stdout_sink()
|
||||
@@ -118,7 +120,8 @@ public:
|
||||
using ansicolor_stdout_sink_mt = ansicolor_stdout_sink<std::mutex>;
|
||||
using ansicolor_stdout_sink_st = ansicolor_stdout_sink<details::null_mutex>;
|
||||
|
||||
template<class Mutex> class ansicolor_stderr_sink : public ansicolor_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class ansicolor_stderr_sink : public ansicolor_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
ansicolor_stderr_sink()
|
||||
|
@@ -18,7 +18,8 @@
|
||||
#include <mutex>
|
||||
|
||||
namespace spdlog { namespace sinks {
|
||||
template<class Mutex> class base_sink : public sink
|
||||
template<class Mutex>
|
||||
class base_sink : public sink
|
||||
{
|
||||
public:
|
||||
base_sink() = default;
|
||||
|
@@ -18,7 +18,8 @@
|
||||
// Distribution sink (mux). Stores a vector of sinks which get called when log is called
|
||||
|
||||
namespace spdlog { namespace sinks {
|
||||
template<class Mutex> class dist_sink : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class dist_sink : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
explicit dist_sink()
|
||||
|
@@ -22,7 +22,8 @@ namespace spdlog { namespace sinks {
|
||||
/*
|
||||
* Trivial file sink with single file as target
|
||||
*/
|
||||
template<class Mutex> class simple_file_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class simple_file_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
explicit simple_file_sink(const filename_t &filename, bool truncate = false)
|
||||
@@ -60,7 +61,8 @@ using simple_file_sink_st = simple_file_sink<details::null_mutex>;
|
||||
/*
|
||||
* Rotating file sink based on size
|
||||
*/
|
||||
template<class Mutex> class rotating_file_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class rotating_file_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
rotating_file_sink(filename_t base_filename, std::size_t max_size, std::size_t max_files)
|
||||
@@ -185,7 +187,8 @@ struct dateonly_daily_file_name_calculator
|
||||
/*
|
||||
* Rotating file sink based on date. rotates at midnight
|
||||
*/
|
||||
template<class Mutex, class FileNameCalc = default_daily_file_name_calculator> class daily_file_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
template<class Mutex, class FileNameCalc = default_daily_file_name_calculator>
|
||||
class daily_file_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
// create daily file sink which rotates on given time
|
||||
|
@@ -19,7 +19,8 @@ namespace spdlog { namespace sinks {
|
||||
/*
|
||||
* MSVC sink (logging using OutputDebugStringA)
|
||||
*/
|
||||
template<class Mutex> class msvc_sink : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class msvc_sink : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
explicit msvc_sink() {}
|
||||
|
@@ -12,7 +12,8 @@
|
||||
|
||||
namespace spdlog { namespace sinks {
|
||||
|
||||
template<class Mutex> class null_sink : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class null_sink : public base_sink<Mutex>
|
||||
{
|
||||
protected:
|
||||
void _sink_it(const details::log_msg &) override {}
|
||||
|
@@ -12,7 +12,8 @@
|
||||
#include <ostream>
|
||||
|
||||
namespace spdlog { namespace sinks {
|
||||
template<class Mutex> class ostream_sink : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class ostream_sink : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
explicit ostream_sink(std::ostream &os, bool force_flush = false)
|
||||
|
@@ -14,7 +14,8 @@
|
||||
|
||||
namespace spdlog { namespace sinks {
|
||||
|
||||
template<class Mutex> class stdout_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class stdout_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
{
|
||||
using MyType = stdout_sink<Mutex>;
|
||||
|
||||
@@ -43,7 +44,8 @@ protected:
|
||||
using stdout_sink_mt = stdout_sink<std::mutex>;
|
||||
using stdout_sink_st = stdout_sink<details::null_mutex>;
|
||||
|
||||
template<class Mutex> class stderr_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class stderr_sink SPDLOG_FINAL : public base_sink<Mutex>
|
||||
{
|
||||
using MyType = stderr_sink<Mutex>;
|
||||
|
||||
|
@@ -18,7 +18,8 @@ namespace spdlog { 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>
|
||||
template<class Mutex>
|
||||
class wincolor_sink : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
const WORD BOLD = FOREGROUND_INTENSITY;
|
||||
@@ -89,7 +90,8 @@ private:
|
||||
//
|
||||
// windows color console to stdout
|
||||
//
|
||||
template<class Mutex> class wincolor_stdout_sink : public wincolor_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class wincolor_stdout_sink : public wincolor_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
wincolor_stdout_sink()
|
||||
@@ -104,7 +106,8 @@ using wincolor_stdout_sink_st = wincolor_stdout_sink<details::null_mutex>;
|
||||
//
|
||||
// windows color console to stderr
|
||||
//
|
||||
template<class Mutex> class wincolor_stderr_sink : public wincolor_sink<Mutex>
|
||||
template<class Mutex>
|
||||
class wincolor_stderr_sink : public wincolor_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
wincolor_stderr_sink()
|
||||
|
@@ -14,7 +14,8 @@ namespace spdlog { namespace sinks {
|
||||
/*
|
||||
* Windows debug sink (logging using OutputDebugStringA, synonym for msvc_sink)
|
||||
*/
|
||||
template<class Mutex> using windebug_sink = msvc_sink<Mutex>;
|
||||
template<class Mutex>
|
||||
using windebug_sink = msvc_sink<Mutex>;
|
||||
|
||||
using windebug_sink_mt = msvc_sink_mt;
|
||||
using windebug_sink_st = msvc_sink_st;
|
||||
|
Reference in New Issue
Block a user