diff --git a/example/bench.cpp b/example/bench.cpp index 82b47bc0..25803094 100644 --- a/example/bench.cpp +++ b/example/bench.cpp @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) int queue_size = 1048576; int howmany = 1000000; - int threads = 10; + int threads = 1; int file_size = 30 * 1024 * 1024; int rotating_files = 5; @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) threads = atoi(argv[2]); if (argc > 3) queue_size = atoi(argv[3]); - + /* cout << "*******************************************************************************\n"; cout << "Single thread, " << format(howmany) << " iterations" << endl; cout << "*******************************************************************************\n"; @@ -67,15 +67,15 @@ int main(int argc, char *argv[]) auto daily_mt = spdlog::daily_logger_mt("daily_mt", "logs/daily_mt.log"); bench_mt(howmany, daily_mt, threads); bench(howmany, spdlog::create("null_mt")); - +*/ cout << "\n*******************************************************************************\n"; cout << "async logging.. " << threads << " threads sharing same logger, " << format(howmany) << " iterations " << endl; cout << "*******************************************************************************\n"; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 300; ++i) { spdlog::init_thread_pool(queue_size, 1); - auto as = spdlog::daily_logger_mt("as", "logs/daily_async.log"); + auto as = spdlog::basic_logger_mt("as", "logs/basic_async.log", true); bench_mt(howmany, as, threads); spdlog::drop("as"); } diff --git a/example/example.cpp b/example/example.cpp index 00111a2d..f9859d70 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -59,7 +59,7 @@ int main(int, char *[]) daily_logger->info(123.44); // Customize msg format for all messages - // spd::set_pattern("[%^+++%$] [%H:%M:%S %z] [thread %t] %v"); //crash + spd::set_pattern("[%^+++%$] [%H:%M:%S %z] [thread %t] %v"); console->info("This an info message with custom format"); console->error("This an error message with custom format");