diff --git a/include/spdlog/sinks/http_sink.h b/include/spdlog/sinks/http_sink.h new file mode 100644 index 00000000..25a25a64 --- /dev/null +++ b/include/spdlog/sinks/http_sink.h @@ -0,0 +1,39 @@ +#pragma once + +#include +#include +#include + +// Simple http sink +// Connects to an endpoint and sends the formatted log. +// Will attempt to reconnect if endpoint drops. + + +namespace spdlog { +namespace sinks { + +struct http_sink_config { +}; + +template +class http_sink : public spdlog::sinks::base_sink +{ +public: + explicit http_sink(http_sink_config config) + { + config_ = move(config); + } + + ~http_sink() override = default; + +protected: + void sink_it_(const spdlog::details::log_msg &msg) override {} + + void flush_() override {} + +private: + http_sink_config config_; +}; + +} // namespace sinks +} // namespace spdlog \ No newline at end of file