From dcf5c9e36f28f7b3968a2a531a7cbe60ac30fac7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-QDBPML1\\Patryk" Date: Mon, 16 Jun 2025 16:19:32 +0200 Subject: [PATCH] initial commit Added stub file for http_sink, used tcp_sink as template --- include/spdlog/sinks/http_sink.h | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 include/spdlog/sinks/http_sink.h 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