From a0e631802cadd089bc496e7a4df8a5c9fd846651 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 29 Sep 2023 00:05:17 +0300 Subject: [PATCH] Replaced include with include "spdlog/.." --- cmake/pch.h.in | 2 +- include/spdlog/sinks/dup_filter_sink.h | 2 +- include/spdlog/stopwatch.h | 2 +- src/async_logger.cpp | 6 +++--- src/cfg/helpers.cpp | 6 +++--- src/common.cpp | 2 +- src/details/file_helper.cpp | 6 +++--- src/details/log_msg.cpp | 4 ++-- src/details/log_msg_buffer.cpp | 2 +- src/details/os.cpp | 6 +++--- src/details/periodic_worker.cpp | 2 +- src/details/registry.cpp | 15 +++++++-------- src/details/thread_pool.cpp | 4 ++-- src/fmt/bundled_fmtlib_format.cpp | 2 +- src/logger.cpp | 6 +++--- src/pattern_formatter.cpp | 14 +++++++------- src/sinks/ansicolor_sink.cpp | 6 +++--- src/sinks/base_sink.cpp | 6 +++--- src/sinks/basic_file_sink.cpp | 6 +++--- src/sinks/rotating_file_sink.cpp | 10 +++++----- src/sinks/sink.cpp | 4 ++-- src/sinks/stdout_color_sinks.cpp | 10 +++++----- src/sinks/stdout_sinks.cpp | 14 +++++++------- src/sinks/wincolor_sink.cpp | 8 ++++---- src/spdlog.cpp | 6 +++--- 25 files changed, 75 insertions(+), 76 deletions(-) diff --git a/cmake/pch.h.in b/cmake/pch.h.in index a5f94150..52fc8683 100644 --- a/cmake/pch.h.in +++ b/cmake/pch.h.in @@ -255,4 +255,4 @@ #include // spdlog -#include \ No newline at end of file +#include "spdlog/common.h" \ No newline at end of file diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index d3e36bd8..12cd1c34 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -17,7 +17,7 @@ // // Example: // -// #include +// #include "spdlog/sinks/dup_filter_sink.h" // // int main() { // auto dup_filter = std::make_shared(std::chrono::seconds(5), diff --git a/include/spdlog/stopwatch.h b/include/spdlog/stopwatch.h index ad40f95d..966a69a6 100644 --- a/include/spdlog/stopwatch.h +++ b/include/spdlog/stopwatch.h @@ -20,7 +20,7 @@ // If other units are needed (e.g. millis instead of double), include "fmt/chrono.h" and use // "duration_cast<..>(sw.elapsed())": // -// #include +// #include "spdlog/fmt/chrono.h" //.. // using std::chrono::duration_cast; // using std::chrono::milliseconds; diff --git a/src/async_logger.cpp b/src/async_logger.cpp index 1a62cef4..f1f615c6 100644 --- a/src/async_logger.cpp +++ b/src/async_logger.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include +#include "spdlog/async_logger.h" +#include "spdlog/details/thread_pool.h" +#include "spdlog/sinks/sink.h" #include #include diff --git a/src/cfg/helpers.cpp b/src/cfg/helpers.cpp index 0dfab508..6b498107 100644 --- a/src/cfg/helpers.cpp +++ b/src/cfg/helpers.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include +#include "spdlog/cfg/helpers.h" +#include "spdlog/details/registry.h" +#include "spdlog/spdlog.h" #include #include diff --git a/src/common.cpp b/src/common.cpp index ea34e848..f67e5ab8 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1,7 +1,7 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/common.h" #include #include diff --git a/src/details/file_helper.cpp b/src/details/file_helper.cpp index 375953c7..1a6a119f 100644 --- a/src/details/file_helper.cpp +++ b/src/details/file_helper.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include +#include "spdlog/common.h" +#include "spdlog/details/file_helper.h" +#include "spdlog/details/os.h" #include #include diff --git a/src/details/log_msg.cpp b/src/details/log_msg.cpp index f12d8ec5..6e212fff 100644 --- a/src/details/log_msg.cpp +++ b/src/details/log_msg.cpp @@ -1,8 +1,8 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include +#include "spdlog/details/log_msg.h" +#include "spdlog/details/os.h" namespace spdlog { namespace details { diff --git a/src/details/log_msg_buffer.cpp b/src/details/log_msg_buffer.cpp index 1ae77e96..b3fd95d5 100644 --- a/src/details/log_msg_buffer.cpp +++ b/src/details/log_msg_buffer.cpp @@ -1,7 +1,7 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/details/log_msg_buffer.h" namespace spdlog { namespace details { diff --git a/src/details/os.cpp b/src/details/os.cpp index b25f35f3..57f616cb 100644 --- a/src/details/os.cpp +++ b/src/details/os.cpp @@ -1,8 +1,8 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include +#include "spdlog/common.h" +#include "spdlog/details/os.h" #include #include @@ -16,7 +16,7 @@ #include #ifdef _WIN32 - #include + #include "spdlog/details/windows_include.h" #include // for FlushFileBuffers #include // for _get_osfhandle, _isatty, _fileno #include // for _get_pid diff --git a/src/details/periodic_worker.cpp b/src/details/periodic_worker.cpp index a00362f3..9a54b265 100644 --- a/src/details/periodic_worker.cpp +++ b/src/details/periodic_worker.cpp @@ -1,7 +1,7 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/details/periodic_worker.h" namespace spdlog { namespace details { diff --git a/src/details/registry.cpp b/src/details/registry.cpp index ca950929..4a1708da 100644 --- a/src/details/registry.cpp +++ b/src/details/registry.cpp @@ -1,19 +1,18 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include - -#include -#include -#include -#include +#include "spdlog/details/registry.h" +#include "spdlog/common.h" +#include "spdlog/details/periodic_worker.h" +#include "spdlog/logger.h" +#include "spdlog/pattern_formatter.h" #ifndef SPDLOG_DISABLE_DEFAULT_LOGGER // support for the default stdout color logger #ifdef _WIN32 - #include + #include "spdlog/sinks/wincolor_sink.h" #else - #include + #include "spdlog/sinks/ansicolor_sink.h" #endif #endif // SPDLOG_DISABLE_DEFAULT_LOGGER diff --git a/src/details/thread_pool.cpp b/src/details/thread_pool.cpp index ae8652e7..94f9b676 100644 --- a/src/details/thread_pool.cpp +++ b/src/details/thread_pool.cpp @@ -2,8 +2,8 @@ // Distributed under the MIT License (http://opensource.org/licenses/MIT) #include -#include -#include +#include "spdlog/common.h" +#include "spdlog/details/thread_pool.h" namespace spdlog { namespace details { diff --git a/src/fmt/bundled_fmtlib_format.cpp b/src/fmt/bundled_fmtlib_format.cpp index 96d75d49..3b519ce0 100644 --- a/src/fmt/bundled_fmtlib_format.cpp +++ b/src/fmt/bundled_fmtlib_format.cpp @@ -4,7 +4,7 @@ #if !defined(SPDLOG_FMT_EXTERNAL) && !defined(SPDLOG_USE_STD_FORMAT) - #include + #include "spdlog/fmt/bundled/format-inl.h" FMT_BEGIN_NAMESPACE namespace detail { diff --git a/src/logger.cpp b/src/logger.cpp index a08895cc..007ee9ea 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include +#include "spdlog/logger.h" +#include "spdlog/pattern_formatter.h" +#include "spdlog/sinks/sink.h" #include #include diff --git a/src/pattern_formatter.cpp b/src/pattern_formatter.cpp index 777b3cce..2cd60250 100644 --- a/src/pattern_formatter.cpp +++ b/src/pattern_formatter.cpp @@ -1,13 +1,13 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include -#include -#include -#include -#include +#include "spdlog/details/fmt_helper.h" +#include "spdlog/details/log_msg.h" +#include "spdlog/details/os.h" +#include "spdlog/fmt/fmt.h" +#include "spdlog/formatter.h" +#include "spdlog/pattern_formatter.h" +#include "spdlog/common.h" #include #include diff --git a/src/sinks/ansicolor_sink.cpp b/src/sinks/ansicolor_sink.cpp index 32df8351..31ff5b4b 100644 --- a/src/sinks/ansicolor_sink.cpp +++ b/src/sinks/ansicolor_sink.cpp @@ -1,10 +1,10 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/sinks/ansicolor_sink.h" -#include -#include +#include "spdlog/details/os.h" +#include "spdlog/pattern_formatter.h" namespace spdlog { namespace sinks { diff --git a/src/sinks/base_sink.cpp b/src/sinks/base_sink.cpp index cdbd9127..79aa029d 100644 --- a/src/sinks/base_sink.cpp +++ b/src/sinks/base_sink.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include +#include "spdlog/common.h" +#include "spdlog/pattern_formatter.h" +#include "spdlog/sinks/base_sink.h" #include #include diff --git a/src/sinks/basic_file_sink.cpp b/src/sinks/basic_file_sink.cpp index 8fb00a41..98f5d7a8 100644 --- a/src/sinks/basic_file_sink.cpp +++ b/src/sinks/basic_file_sink.cpp @@ -1,10 +1,10 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/sinks/basic_file_sink.h" -#include -#include +#include "spdlog/common.h" +#include "spdlog/details/os.h" namespace spdlog { namespace sinks { diff --git a/src/sinks/rotating_file_sink.cpp b/src/sinks/rotating_file_sink.cpp index b52077ff..8b28dbdc 100644 --- a/src/sinks/rotating_file_sink.cpp +++ b/src/sinks/rotating_file_sink.cpp @@ -1,12 +1,12 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/sinks/rotating_file_sink.h" -#include -#include -#include -#include +#include "spdlog/common.h" +#include "spdlog/details/file_helper.h" +#include "spdlog/details/os.h" +#include "spdlog/fmt/fmt.h" #include #include diff --git a/src/sinks/sink.cpp b/src/sinks/sink.cpp index a19c21d4..b7040c07 100644 --- a/src/sinks/sink.cpp +++ b/src/sinks/sink.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include +#include "spdlog/sinks/sink.h" -#include +#include "spdlog/common.h" bool spdlog::sinks::sink::should_log(spdlog::level msg_level) const { return msg_level >= level_.load(std::memory_order_relaxed); diff --git a/src/sinks/stdout_color_sinks.cpp b/src/sinks/stdout_color_sinks.cpp index 54bb8e3b..8fdc3442 100644 --- a/src/sinks/stdout_color_sinks.cpp +++ b/src/sinks/stdout_color_sinks.cpp @@ -1,11 +1,11 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include -#include -#include +#include "spdlog/async.h" +#include "spdlog/common.h" +#include "spdlog/details/synchronous_factory.h" +#include "spdlog/logger.h" +#include "spdlog/sinks/stdout_color_sinks.h" namespace spdlog { diff --git a/src/sinks/stdout_sinks.cpp b/src/sinks/stdout_sinks.cpp index 08169c31..d191aa8b 100644 --- a/src/sinks/stdout_sinks.cpp +++ b/src/sinks/stdout_sinks.cpp @@ -2,13 +2,13 @@ // Distributed under the MIT License (http://opensource.org/licenses/MIT) #include -#include -#include +#include "spdlog/pattern_formatter.h" +#include "spdlog/sinks/stdout_sinks.h" #ifdef _WIN32 // under windows using fwrite to non-binary stream results in \r\r\n (see issue #1675) // so instead we use ::FileWrite - #include + #include "spdlog/details/windows_include.h" #ifndef _USING_V110_SDK71_ // fileapi.h doesn't exist in winxp #include // WriteFile (..) @@ -16,7 +16,7 @@ #include // _get_osfhandle(..) #include // _fileno(..) -#endif // WIN32 +#endif // _WIN32 namespace spdlog { @@ -120,7 +120,7 @@ std::shared_ptr stderr_logger_st(const std::string &logger_name) { } // namespace spdlog // template instantiations for stdout/stderr loggers -#include +#include "spdlog/details/console_globals.h" template class SPDLOG_API spdlog::sinks::stdout_sink_base; template class SPDLOG_API spdlog::sinks::stdout_sink_base; template class SPDLOG_API spdlog::sinks::stdout_sink; @@ -129,8 +129,8 @@ template class SPDLOG_API spdlog::sinks::stderr_sink; // template instantiations for stdout/stderr factory functions -#include -#include +#include "spdlog/async.h" +#include "spdlog/details/synchronous_factory.h" template SPDLOG_API std::shared_ptr spdlog::stdout_logger_mt(const std::string &logger_name); diff --git a/src/sinks/wincolor_sink.cpp b/src/sinks/wincolor_sink.cpp index 21d36461..a8e25d1e 100644 --- a/src/sinks/wincolor_sink.cpp +++ b/src/sinks/wincolor_sink.cpp @@ -2,10 +2,10 @@ // Distributed under the MIT License (http://opensource.org/licenses/MIT) #ifdef _WIN32 - #include - #include - #include - #include + #include "spdlog/common.h" + #include "spdlog/details/windows_include.h" + #include "spdlog/pattern_formatter.h" + #include "spdlog/sinks/wincolor_sink.h" #include diff --git a/src/spdlog.cpp b/src/spdlog.cpp index 912d2393..f2a5ba92 100644 --- a/src/spdlog.cpp +++ b/src/spdlog.cpp @@ -1,9 +1,9 @@ // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. // Distributed under the MIT License (http://opensource.org/licenses/MIT) -#include -#include -#include +#include "spdlog/common.h" +#include "spdlog/pattern_formatter.h" +#include "spdlog/spdlog.h" namespace spdlog {