mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
null sink
This commit is contained in:
@@ -43,18 +43,6 @@ protected:
|
||||
std::atomic<bool> _enabled;
|
||||
};
|
||||
|
||||
class null_sink:public base_sink
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<null_sink>& get()
|
||||
{
|
||||
static auto inst = std::make_shared<null_sink>();
|
||||
return inst;
|
||||
}
|
||||
protected:
|
||||
void _sink_it(const details::log_msg&) override
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
@@ -43,5 +43,7 @@ inline std::shared_ptr<console_sink>& stderr_sink ()
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
18
include/c11log/sinks/null_sink.h
Normal file
18
include/c11log/sinks/null_sink.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include "base_sink.h"
|
||||
|
||||
namespace c11log {
|
||||
namespace sinks {
|
||||
class null_sink : public base_sink
|
||||
{
|
||||
protected:
|
||||
void _sink_it(const details::log_msg&) override
|
||||
{}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user