From 71f0ee98ccc85d41ba7587d122c83011ab1e25c3 Mon Sep 17 00:00:00 2001 From: F1F7Y <64418963+F1F7Y@users.noreply.github.com> Date: Fri, 30 Jun 2023 03:10:24 +0200 Subject: Reorganize third-party dependencies into `thirdparty` directory (#491) * rename `include` to `thirdparty` * remove duplicate minhook in wsock32 * move minhook into its own directory * move openssl lib into separate directories --- thirdparty/spdlog/sinks/basic_file_sink.h | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 thirdparty/spdlog/sinks/basic_file_sink.h (limited to 'thirdparty/spdlog/sinks/basic_file_sink.h') diff --git a/thirdparty/spdlog/sinks/basic_file_sink.h b/thirdparty/spdlog/sinks/basic_file_sink.h new file mode 100644 index 00000000..4a742624 --- /dev/null +++ b/thirdparty/spdlog/sinks/basic_file_sink.h @@ -0,0 +1,58 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include +#include +#include + +#include +#include + +namespace spdlog { +namespace sinks { +/* + * Trivial file sink with single file as target + */ +template +class basic_file_sink final : public base_sink +{ +public: + explicit basic_file_sink(const filename_t &filename, bool truncate = false); + const filename_t &filename() const; + +protected: + void sink_it_(const details::log_msg &msg) override; + void flush_() override; + +private: + details::file_helper file_helper_; +}; + +using basic_file_sink_mt = basic_file_sink; +using basic_file_sink_st = basic_file_sink; + +} // namespace sinks + +// +// factory functions +// +template +inline std::shared_ptr basic_logger_mt(const std::string &logger_name, const filename_t &filename, bool truncate = false) +{ + return Factory::template create(logger_name, filename, truncate); +} + +template +inline std::shared_ptr basic_logger_st(const std::string &logger_name, const filename_t &filename, bool truncate = false) +{ + return Factory::template create(logger_name, filename, truncate); +} + +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "basic_file_sink-inl.h" +#endif -- cgit v1.2.3