From 4b9949de7b1f9a855338a98407e180d4aed1d7e9 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 1 Jun 2018 17:52:05 +0300 Subject: [PATCH] format --- bench/bench.cpp | 8 ++------ bench/spdlog-null-async.cpp | 2 +- example/example.cpp | 2 +- include/spdlog/details/mpmc_blocking_q.h | 1 - include/spdlog/details/thread_pool.h | 1 - tests/test_async.cpp | 1 - 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/bench/bench.cpp b/bench/bench.cpp index c06a1c03..fe03fb20 100644 --- a/bench/bench.cpp +++ b/bench/bench.cpp @@ -72,18 +72,14 @@ int main(int argc, char *argv[]) cout << "\n*******************************************************************************\n"; cout << "async logging.. " << threads << " threads sharing same logger, " << format(howmany) << " iterations " << endl; cout << "*******************************************************************************\n"; - + for (int i = 0; i < 3; ++i) { - spdlog::init_thread_pool(queue_size, 1); + spdlog::init_thread_pool(queue_size, 1); auto as = spdlog::basic_logger_mt("as", "logs/basic_async.log", true); bench_mt(howmany, as, threads); spdlog::drop("as"); - } - - - } catch (std::exception &ex) { diff --git a/bench/spdlog-null-async.cpp b/bench/spdlog-null-async.cpp index 2d041657..ee64eb92 100644 --- a/bench/spdlog-null-async.cpp +++ b/bench/spdlog-null-async.cpp @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) spdlog::init_thread_pool(tp_queue_size, tp_threads); auto as = spdlog::create_async_logger("async(null-sink)"); total_rate += bench_as(howmany, as, client_threads); - spdlog::drop("async(null-sink)"); + spdlog::drop("async(null-sink)"); } std::cout << endl; std::cout << "Avg rate: " << format(total_rate / iters) << "/sec" << std::endl; diff --git a/example/example.cpp b/example/example.cpp index 41313fbd..53053080 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -113,7 +113,7 @@ void async_example() for (int i = 0; i < 100; ++i) { async_file->info("Async message #{}", i + 1); - } + } } // syslog example (linux/osx/freebsd) diff --git a/include/spdlog/details/mpmc_blocking_q.h b/include/spdlog/details/mpmc_blocking_q.h index 07cd261a..860fdc67 100644 --- a/include/spdlog/details/mpmc_blocking_q.h +++ b/include/spdlog/details/mpmc_blocking_q.h @@ -71,7 +71,6 @@ public: pop_cv_.notify_one(); return true; } - private: size_t max_items_; diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index fc9dc39f..205403c5 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -138,7 +138,6 @@ public: { return msg_counter_.load(std::memory_order_relaxed); } - private: std::atomic msg_counter_; // total # of messages processed in this pool diff --git a/tests/test_async.cpp b/tests/test_async.cpp index 407cecc7..1c0c8567 100644 --- a/tests/test_async.cpp +++ b/tests/test_async.cpp @@ -77,7 +77,6 @@ TEST_CASE("tp->wait_empty() ", "[async]") logger->flush(); tp.reset(); - REQUIRE(test_sink->msg_counter() == messages); REQUIRE(test_sink->flush_counter() == 1); }