spdlog/include/spdlog/sinks/null_sink.h

29 lines
572 B
C
Raw Normal View History

2016-04-20 11:57:49 +03:00
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//
#pragma once
2018-04-29 01:31:09 +03:00
#include "spdlog/details/null_mutex.h"
#include "spdlog/sinks/base_sink.h"
2016-04-20 11:57:49 +03:00
#include <mutex>
2018-03-17 12:47:46 +02:00
namespace spdlog {
namespace sinks {
2016-04-20 11:57:49 +03:00
template<typename Mutex>
2018-03-16 17:35:56 +02:00
class null_sink : public base_sink<Mutex>
2016-04-20 11:57:49 +03:00
{
protected:
void sink_it_(const details::log_msg &) override {}
void flush_() override {}
2016-04-20 11:57:49 +03:00
};
2018-02-24 22:35:09 +01:00
2018-06-24 01:32:39 +03:00
using null_sink_mt = null_sink<std::mutex>;
2018-02-24 22:35:09 +01:00
using null_sink_st = null_sink<details::null_mutex>;
2016-04-20 11:57:49 +03:00
2018-03-17 12:47:46 +02:00
} // namespace sinks
} // namespace spdlog