From 46bed8d09f32360377350d71816a76abdfbf2c7c Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:32:31 +0100 Subject: Adjust folder structure (#242) * Adjust folder structure * change launcher directory name --- NorthstarDLL/include/spdlog/sinks/stdout_sinks.h | 87 ++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 NorthstarDLL/include/spdlog/sinks/stdout_sinks.h (limited to 'NorthstarDLL/include/spdlog/sinks/stdout_sinks.h') diff --git a/NorthstarDLL/include/spdlog/sinks/stdout_sinks.h b/NorthstarDLL/include/spdlog/sinks/stdout_sinks.h new file mode 100644 index 00000000..40688a46 --- /dev/null +++ b/NorthstarDLL/include/spdlog/sinks/stdout_sinks.h @@ -0,0 +1,87 @@ +// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. +// Distributed under the MIT License (http://opensource.org/licenses/MIT) + +#pragma once + +#include +#include +#include +#include + +#ifdef _WIN32 +#include +#endif + +namespace spdlog { + +namespace sinks { + +template +class stdout_sink_base : public sink +{ +public: + using mutex_t = typename ConsoleMutex::mutex_t; + explicit stdout_sink_base(FILE *file); + ~stdout_sink_base() override = default; + + stdout_sink_base(const stdout_sink_base &other) = delete; + stdout_sink_base(stdout_sink_base &&other) = delete; + + stdout_sink_base &operator=(const stdout_sink_base &other) = delete; + stdout_sink_base &operator=(stdout_sink_base &&other) = delete; + + void log(const details::log_msg &msg) override; + void flush() override; + void set_pattern(const std::string &pattern) override; + + void set_formatter(std::unique_ptr sink_formatter) override; + +protected: + mutex_t &mutex_; + FILE *file_; + std::unique_ptr formatter_; +#ifdef _WIN32 + HANDLE handle_; +#endif // WIN32 +}; + +template +class stdout_sink : public stdout_sink_base +{ +public: + stdout_sink(); +}; + +template +class stderr_sink : public stdout_sink_base +{ +public: + stderr_sink(); +}; + +using stdout_sink_mt = stdout_sink; +using stdout_sink_st = stdout_sink; + +using stderr_sink_mt = stderr_sink; +using stderr_sink_st = stderr_sink; + +} // namespace sinks + +// factory methods +template +std::shared_ptr stdout_logger_mt(const std::string &logger_name); + +template +std::shared_ptr stdout_logger_st(const std::string &logger_name); + +template +std::shared_ptr stderr_logger_mt(const std::string &logger_name); + +template +std::shared_ptr stderr_logger_st(const std::string &logger_name); + +} // namespace spdlog + +#ifdef SPDLOG_HEADER_ONLY +#include "stdout_sinks-inl.h" +#endif -- cgit v1.2.3