You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spdlog/test/test.cpp

36 lines
775 B
C++

// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
12 years ago
int main(int argc, char* argv[])
{
c11log::logger logger("test");
12 years ago
auto screen_sink = std::make_shared<c11log::sinks::stdout_sink>();
auto file_sink = std::make_shared<c11log::sinks::midnight_file_sink>("logtest");
auto async = std::make_shared<c11log::sinks::async_sink>(1000);
async->add_sink(file_sink);
logger.add_sink(async);
12 years ago
//logger.add_sink(file_sink);
auto fn = [&logger]()
{
logger.info() << "Hello logger!";
};
utils::bench("test log", std::chrono::seconds(3), fn);
logger.info() << "bye";
utils::bench("shutdown", [&async]() {
async->shutdown(std::chrono::seconds(10));
});
return 0;
}