mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
code format
This commit is contained in:
@@ -6,14 +6,14 @@
|
||||
//
|
||||
// bench.cpp : spdlog benchmarks
|
||||
//
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <locale>
|
||||
#include <algorithm>
|
||||
|
||||
#include "spdlog/sinks/async_sink.h"
|
||||
#include "spdlog/sinks/basic_file_sink.h"
|
||||
@@ -103,7 +103,7 @@ int main(int argc, char *argv[]) {
|
||||
auto logger = std::make_shared<spdlog::logger>("async_logger", std::move(async_sink));
|
||||
bench_mt(howmany, std::move(logger), threads);
|
||||
}
|
||||
//verify_file(filename, howmany); // in separate scope to ensure logger is destroyed and all logs were written
|
||||
// verify_file(filename, howmany); // in separate scope to ensure logger is destroyed and all logs were written
|
||||
}
|
||||
spdlog::info("");
|
||||
spdlog::info("*********************************");
|
||||
|
@@ -124,7 +124,8 @@ int main(int argc, char *argv[]) {
|
||||
benchmark::RegisterBenchmark("basic_st", bench_logger, std::move(basic_st))->UseRealTime();
|
||||
|
||||
// rotating st
|
||||
auto rotating_st = spdlog::create<rotating_file_sink_st>("rotating_st", "latency_logs/rotating_st.log", file_size, rotating_files);
|
||||
auto rotating_st =
|
||||
spdlog::create<rotating_file_sink_st>("rotating_st", "latency_logs/rotating_st.log", file_size, rotating_files);
|
||||
benchmark::RegisterBenchmark("rotating_st", bench_logger, std::move(rotating_st))->UseRealTime();
|
||||
|
||||
// daily st
|
||||
@@ -142,7 +143,8 @@ int main(int argc, char *argv[]) {
|
||||
benchmark::RegisterBenchmark("basic_mt", bench_logger, std::move(basic_mt))->Threads(n_threads)->UseRealTime();
|
||||
|
||||
// rotating mt
|
||||
auto rotating_mt = spdlog::create<rotating_file_sink_mt>("rotating_mt", "latency_logs/rotating_mt.log", file_size, rotating_files);
|
||||
auto rotating_mt =
|
||||
spdlog::create<rotating_file_sink_mt>("rotating_mt", "latency_logs/rotating_mt.log", file_size, rotating_files);
|
||||
benchmark::RegisterBenchmark("rotating_mt", bench_logger, std::move(rotating_mt))->Threads(n_threads)->UseRealTime();
|
||||
|
||||
// daily mt
|
||||
@@ -151,7 +153,8 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
using spdlog::sinks::async_sink;
|
||||
async_sink::config config;
|
||||
config.queue_size = 3 * 1024 * 1024;;
|
||||
config.queue_size = 3 * 1024 * 1024;
|
||||
;
|
||||
config.sinks.push_back(std::make_shared<null_sink_st>());
|
||||
config.policy = async_sink::overflow_policy::overrun_oldest;
|
||||
auto async_logger = std::make_shared<spdlog::logger>("async_logger", std::make_shared<async_sink>(config));
|
||||
|
Reference in New Issue
Block a user