update spdlog
This commit is contained in:
2
third_party/spdlog/bench/CMakeLists.txt
vendored
2
third_party/spdlog/bench/CMakeLists.txt
vendored
@ -24,5 +24,3 @@ target_link_libraries(latency PRIVATE benchmark::benchmark spdlog::spdlog)
|
||||
|
||||
add_executable(formatter-bench formatter-bench.cpp)
|
||||
target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog)
|
||||
|
||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
|
||||
|
22
third_party/spdlog/bench/latency.cpp
vendored
22
third_party/spdlog/bench/latency.cpp
vendored
@ -16,26 +16,6 @@
|
||||
#include "spdlog/sinks/null_sink.h"
|
||||
#include "spdlog/sinks/rotating_file_sink.h"
|
||||
|
||||
void prepare_logdir()
|
||||
{
|
||||
spdlog::info("Preparing latency_logs directory..");
|
||||
#ifdef _WIN32
|
||||
system("if not exist logs mkdir latency_logs");
|
||||
system("del /F /Q logs\\*");
|
||||
#else
|
||||
auto rv = system("mkdir -p latency_logs");
|
||||
if (rv != 0)
|
||||
{
|
||||
throw std::runtime_error("Failed to mkdir -p latency_logs");
|
||||
}
|
||||
rv = system("rm -f latency_logs/*");
|
||||
if (rv != 0)
|
||||
{
|
||||
throw std::runtime_error("Failed to rm -f latency_logs/*");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void bench_c_string(benchmark::State &state, std::shared_ptr<spdlog::logger> logger)
|
||||
{
|
||||
const char *msg = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum pharetra metus cursus "
|
||||
@ -83,8 +63,6 @@ int main(int argc, char *argv[])
|
||||
size_t rotating_files = 5;
|
||||
int n_threads = benchmark::CPUInfo::Get().num_cpus;
|
||||
|
||||
prepare_logdir();
|
||||
|
||||
// disabled loggers
|
||||
auto disabled_logger = std::make_shared<spdlog::logger>("bench", std::make_shared<null_sink_mt>());
|
||||
disabled_logger->set_level(spdlog::level::off);
|
||||
|
1
third_party/spdlog/bench/meson.build
vendored
1
third_party/spdlog/bench/meson.build
vendored
@ -12,4 +12,3 @@ foreach i : bench_matrix
|
||||
benchmark('bench_' + i[0], bench_exe, args: i[2])
|
||||
endforeach
|
||||
|
||||
run_command(find_program('mkdir'), meson.current_build_dir() + '/logs')
|
||||
|
Reference in New Issue
Block a user