From 5f276971981042d9991eadb92429af0ea02d1541 Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 10 Jul 2019 02:42:47 +0300 Subject: [PATCH] clang-format --- bench/bench.cpp | 1 - example/example.cpp | 1 + include/spdlog/details/pattern_formatter-inl.h | 6 ++---- include/spdlog/sinks/dup_filter_sink.h | 1 - include/spdlog/sinks/syslog_sink.h | 2 +- include/spdlog/sinks/systemd_sink.h | 7 +++---- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/bench/bench.cpp b/bench/bench.cpp index 5b8437aa..8a432833 100644 --- a/bench/bench.cpp +++ b/bench/bench.cpp @@ -39,7 +39,6 @@ int main(int argc, char *argv[]) size_t file_size = 30 * 1024 * 1024; size_t rotating_files = 5; - try { diff --git a/example/example.cpp b/example/example.cpp index ce57fc9d..8ab14847 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -23,6 +23,7 @@ void clone_example(); int main(int, char *[]) { + syslog_example(); spdlog::info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH); spdlog::warn("Easy padding in numbers like {:08d}", 12); spdlog::critical("Support for int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}", 42); diff --git a/include/spdlog/details/pattern_formatter-inl.h b/include/spdlog/details/pattern_formatter-inl.h index b0cc2669..e45bc3cd 100644 --- a/include/spdlog/details/pattern_formatter-inl.h +++ b/include/spdlog/details/pattern_formatter-inl.h @@ -892,13 +892,12 @@ public: template class elapsed_formatter final : public flag_formatter { - public: using DurationUnits = Units; explicit elapsed_formatter(padding_info padinfo) - : flag_formatter(padinfo), - last_message_time_(log_clock::now()) + : flag_formatter(padinfo) + , last_message_time_(log_clock::now()) {} void format(const details::log_msg &msg, const std::tm &, fmt::memory_buffer &dest) override @@ -919,7 +918,6 @@ public: protected: log_clock::time_point last_message_time_; - }; // Full info formatter diff --git a/include/spdlog/sinks/dup_filter_sink.h b/include/spdlog/sinks/dup_filter_sink.h index e43ab949..66c59359 100644 --- a/include/spdlog/sinks/dup_filter_sink.h +++ b/include/spdlog/sinks/dup_filter_sink.h @@ -33,7 +33,6 @@ // [2019-06-25 17:50:56.512] [logger] [info] Skipped 3 duplicate messages.. // [2019-06-25 17:50:56.512] [logger] [info] Different Hello - #ifdef SPDLOG_NO_DATETIME #error "spdlog::sinks::dup_filter_sink: cannot work when SPDLOG_NO_DATETIME is defined" #endif diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index a160c10d..8546915c 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -61,7 +61,7 @@ protected: size_t length = payload.size(); // limit to max int - if(length > std::numeric_limits::max()) + if (length > std::numeric_limits::max()) { length = std::numeric_limits::max(); } diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index 4f626afe..ecc54a29 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -46,7 +46,7 @@ protected: size_t length = msg.payload.size(); // limit to max int - if(length > std::numeric_limits::max()) + if (length > std::numeric_limits::max()) { length = std::numeric_limits::max(); } @@ -60,9 +60,8 @@ protected: } else { - err = (sd_journal_send)("MESSAGE=%.*s", static_cast(length), msg.payload.data(), "PRIORITY=%d", - syslog_level(msg.level), "SOURCE_FILE=%s", msg.source.filename, "SOURCE_LINE=%d", msg.source.line, "SOURCE_FUNC=%s", - msg.source.funcname, nullptr); + err = (sd_journal_send)("MESSAGE=%.*s", static_cast(length), msg.payload.data(), "PRIORITY=%d", syslog_level(msg.level), + "SOURCE_FILE=%s", msg.source.filename, "SOURCE_LINE=%d", msg.source.line, "SOURCE_FUNC=%s", msg.source.funcname, nullptr); } if (err)