From 0a5ada6411cbbd2296b7b08def15ed6ed0726eeb Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 21 Mar 2020 15:25:26 +0200 Subject: [PATCH] clang-format --- example/example.cpp | 11 +++++------ include/spdlog/pattern_formatter-inl.h | 4 ++-- tests/test_pattern_formatter.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/example/example.cpp b/example/example.cpp index 1c8d189e..ef8f23ff 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -254,7 +254,6 @@ void android_example() } #endif - // Log patterns can contain custom flags. // this will add custom flag '%*' which will be bound to a instance #include "spdlog/pattern_formatter.h" @@ -274,10 +273,10 @@ public: }; void custom_flags_example() -{ - - using spdlog::details::make_unique; // for pre c++14 +{ + + using spdlog::details::make_unique; // for pre c++14 auto formatter = make_unique(); - formatter->add_flag('*').set_pattern("[%n] [%*] [%^%l%$] %v"); - spdlog::set_formatter(std::move(formatter)); + formatter->add_flag('*').set_pattern("[%n] [%*] [%^%l%$] %v"); + spdlog::set_formatter(std::move(formatter)); } diff --git a/include/spdlog/pattern_formatter-inl.h b/include/spdlog/pattern_formatter-inl.h index 787ab422..d333555d 100644 --- a/include/spdlog/pattern_formatter-inl.h +++ b/include/spdlog/pattern_formatter-inl.h @@ -1044,7 +1044,7 @@ SPDLOG_INLINE void pattern_formatter::handle_flag_(char flag, details::padding_i { // process custom flags auto it = custom_handlers_.find(flag); - if (it != custom_handlers_.end()) + if (it != custom_handlers_.end()) { auto custom_handler = it->second->clone(); custom_handler->set_padding_info(padding); @@ -1053,7 +1053,7 @@ SPDLOG_INLINE void pattern_formatter::handle_flag_(char flag, details::padding_i } // process built-in flags - switch (flag) + switch (flag) { case ('+'): // default formatter formatters_.push_back(details::make_unique(padding)); diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index 720241fe..d0ce6410 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -308,7 +308,9 @@ TEST_CASE("clone-formatter-2", "[pattern_formatter]") class custom_test_flag : public spdlog::custom_flag_formatter { public: - custom_test_flag(std::string txt) : some_txt{std::move(txt)} {} + custom_test_flag(std::string txt) + : some_txt{std::move(txt)} + {} void format(const spdlog::details::log_msg &, const std::tm &, spdlog::memory_buf_t &dest) override { @@ -316,7 +318,7 @@ public: { throw spdlog::spdlog_ex("custom_flag_exception_test"); } - some_txt = std::string(padinfo_.width_, ' ') + some_txt; + some_txt = std::string(padinfo_.width_, ' ') + some_txt; dest.append(some_txt.data(), some_txt.data() + some_txt.size()); } spdlog::details::padding_info get_padding_info()