From 6cac90b89a8372f27c44aea9641bebdea90bbdd5 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 28 Jul 2023 17:38:54 +0300 Subject: [PATCH] clang format --- bench/bench.cpp | 1 - include/spdlog/logger-inl.h | 2 -- include/spdlog/logger.h | 7 +++---- include/spdlog/spdlog.h | 1 - tests/CMakeLists.txt | 2 +- tests/test_stdout_api.cpp | 1 - 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/bench/bench.cpp b/bench/bench.cpp index 7ffe66a0..924cbc9f 100644 --- a/bench/bench.cpp +++ b/bench/bench.cpp @@ -46,7 +46,6 @@ void bench_threaded_logging(size_t threads, int iters) auto basic_mt = spdlog::basic_logger_mt("basic_mt", "logs/basic_mt.log", true); bench_mt(iters, std::move(basic_mt), threads); - spdlog::info(""); auto rotating_mt = spdlog::rotating_logger_mt("rotating_mt", "logs/rotating_mt.log", file_size, rotating_files); bench_mt(iters, std::move(rotating_mt), threads); diff --git a/include/spdlog/logger-inl.h b/include/spdlog/logger-inl.h index 59174c1f..7d21d471 100644 --- a/include/spdlog/logger-inl.h +++ b/include/spdlog/logger-inl.h @@ -141,7 +141,6 @@ SPDLOG_INLINE std::shared_ptr logger::clone(std::string logger_name) return cloned; } - SPDLOG_INLINE void logger::sink_it_(const details::log_msg &msg) { for (auto &sink : sinks_) @@ -174,7 +173,6 @@ SPDLOG_INLINE void logger::flush_() } } - SPDLOG_INLINE bool logger::should_flush_(const details::log_msg &msg) { auto flush_level = flush_level_.load(std::memory_order_relaxed); diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 9e0555ef..02a603d0 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -103,7 +103,7 @@ public: void log(log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg) { - if(should_log(lvl)) + if (should_log(lvl)) { sink_it_(details::log_msg(log_time, loc, name_, lvl, msg)); } @@ -111,7 +111,7 @@ public: void log(source_loc loc, level::level_enum lvl, string_view_t msg) { - if(should_log(lvl)) + if (should_log(lvl)) { sink_it_(details::log_msg(loc, name_, lvl, msg)); } @@ -195,8 +195,7 @@ public: } // return true logging is enabled for the given level. - [[nodiscard]] - bool should_log(level::level_enum msg_level) const + [[nodiscard]] bool should_log(level::level_enum msg_level) const { return msg_level >= level_.load(std::memory_order_relaxed); } diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 8ee59232..e7e6abde 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -58,7 +58,6 @@ SPDLOG_API void set_formatter(std::unique_ptr formatter); // example: spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v"); SPDLOG_API void set_pattern(std::string pattern, pattern_time_type time_type = pattern_time_type::local); - // Get global logging level SPDLOG_API level::level_enum get_level(); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 688f3365..439b4fd9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,7 +39,7 @@ set(SPDLOG_UTESTS_SOURCES test_dup_filter.cpp test_fmt_helper.cpp test_stdout_api.cpp - test_create_dir.cpp + test_create_dir.cpp test_custom_callbacks.cpp test_cfg.cpp test_time_point.cpp diff --git a/tests/test_stdout_api.cpp b/tests/test_stdout_api.cpp index c1f1578b..a6bd5874 100644 --- a/tests/test_stdout_api.cpp +++ b/tests/test_stdout_api.cpp @@ -78,4 +78,3 @@ TEST_CASE("stderr_color_mt", "[stderr]") l->critical("Test stderr_color_mt"); spdlog::drop_all(); } -