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 --- include/spdlog/sinks/wincolor_sink.h | 85 ------------------------------------ 1 file changed, 85 deletions(-) delete mode 100644 include/spdlog/sinks/wincolor_sink.h (limited to 'include/spdlog/sinks/wincolor_sink.h') diff --git a/include/spdlog/sinks/wincolor_sink.h b/include/spdlog/sinks/wincolor_sink.h deleted file mode 100644 index a82f1b24..00000000 --- a/include/spdlog/sinks/wincolor_sink.h +++ /dev/null @@ -1,85 +0,0 @@ -// 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 -#include -#include -#include - -namespace spdlog { -namespace sinks { -/* - * Windows color console sink. Uses WriteConsoleA to write to the console with - * colors - */ -template -class wincolor_sink : public sink -{ -public: - wincolor_sink(void *out_handle, color_mode mode); - ~wincolor_sink() override; - - wincolor_sink(const wincolor_sink &other) = delete; - wincolor_sink &operator=(const wincolor_sink &other) = delete; - - // change the color for the given level - void set_color(level::level_enum level, std::uint16_t color); - void log(const details::log_msg &msg) final override; - void flush() final override; - void set_pattern(const std::string &pattern) override final; - void set_formatter(std::unique_ptr sink_formatter) override final; - void set_color_mode(color_mode mode); - -protected: - using mutex_t = typename ConsoleMutex::mutex_t; - void *out_handle_; - mutex_t &mutex_; - bool should_do_colors_; - std::unique_ptr formatter_; - std::array colors_; - - // set foreground color and return the orig console attributes (for resetting later) - std::uint16_t set_foreground_color_(std::uint16_t attribs); - - // print a range of formatted message to console - void print_range_(const memory_buf_t &formatted, size_t start, size_t end); - - // in case we are redirected to file (not in console mode) - void write_to_file_(const memory_buf_t &formatted); - - void set_color_mode_impl(color_mode mode); -}; - -template -class wincolor_stdout_sink : public wincolor_sink -{ -public: - explicit wincolor_stdout_sink(color_mode mode = color_mode::automatic); -}; - -template -class wincolor_stderr_sink : public wincolor_sink -{ -public: - explicit wincolor_stderr_sink(color_mode mode = color_mode::automatic); -}; - -using wincolor_stdout_sink_mt = wincolor_stdout_sink; -using wincolor_stdout_sink_st = wincolor_stdout_sink; - -using wincolor_stderr_sink_mt = wincolor_stderr_sink; -using wincolor_stderr_sink_st = wincolor_stderr_sink; -} // namespace sinks -} // namespace spdlog - -#ifdef SPDLOG_HEADER_ONLY -#include "wincolor_sink-inl.h" -#endif -- cgit v1.2.3