From 92d06834cf8ca89b0398f83eb8c9b9d027dd691c Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 7 Dec 2024 19:02:05 +0200 Subject: [PATCH] Fixed bench --- bench/bench.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bench/bench.cpp b/bench/bench.cpp index 2885f4f9..42934576 100644 --- a/bench/bench.cpp +++ b/bench/bench.cpp @@ -31,21 +31,22 @@ static const size_t file_size = 30 * 1024 * 1024; static const size_t rotating_files = 5; static const int max_threads = 1000; +using namespace spdlog::sinks; void bench_threaded_logging(size_t threads, int iters) { spdlog::info("**************************************************************"); spdlog::info( spdlog::fmt_lib::format(std::locale("en_US.UTF-8"), "Multi threaded: {:L} threads, {:L} messages", threads, iters)); spdlog::info("**************************************************************"); - auto basic_mt = spdlog::basic_logger_mt("basic_mt", "logs/basic_mt.log", true); + auto basic_mt = spdlog::create("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); + auto rotating_mt = spdlog::create("rotating_mt", "logs/rotating_mt.log", file_size, rotating_files); bench_mt(iters, std::move(rotating_mt), threads); spdlog::info(""); - auto daily_mt = spdlog::daily_logger_mt("daily_mt", "logs/daily_mt.log"); + auto daily_mt = spdlog::create("daily_mt", "logs/daily_mt.log", 0, 1); bench_mt(iters, std::move(daily_mt), threads); spdlog::info(""); @@ -59,15 +60,15 @@ void bench_single_threaded(int iters) { spdlog::info(spdlog::fmt_lib::format(std::locale("en_US.UTF-8"), "Single threaded: {} messages", iters)); spdlog::info("**************************************************************"); - auto basic_st = spdlog::basic_logger_st("basic_st", "logs/basic_st.log", true); + auto basic_st = spdlog::create("basic_st", "logs/basic_st.log", true); bench(iters, std::move(basic_st)); spdlog::info(""); - auto rotating_st = spdlog::rotating_logger_st("rotating_st", "logs/rotating_st.log", file_size, rotating_files); + auto rotating_st = spdlog::create("rotating_st", "logs/rotating_st.log", file_size, rotating_files); bench(iters, std::move(rotating_st)); spdlog::info(""); - auto daily_st = spdlog::daily_logger_st("daily_st", "logs/daily_st.log"); + auto daily_st = spdlog::create("daily_st", "logs/daily_st.log", 0, 1); bench(iters, std::move(daily_st)); spdlog::info("");