mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
example
This commit is contained in:
parent
5556967ed9
commit
87cc555d0b
@ -20,6 +20,9 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
const unsigned int howmany = argc <= 1 ? 1000:atoi(argv[1]);
|
const unsigned int howmany = argc <= 1 ? 1000:atoi(argv[1]);
|
||||||
|
|
||||||
|
logger cout_logger ("", sinks::stdout_sink());
|
||||||
|
cout_logger.info("Hello ") << "man";
|
||||||
|
|
||||||
auto fsink = std::make_shared<sinks::rotating_file_sink>("log", "txt", 1024*1024*50 , 5, 0);
|
auto fsink = std::make_shared<sinks::rotating_file_sink>("log", "txt", 1024*1024*50 , 5, 0);
|
||||||
|
|
||||||
logger my_logger ("my_logger", sinks::null_sink::get());
|
logger my_logger ("my_logger", sinks::null_sink::get());
|
||||||
@ -31,7 +34,7 @@ int main(int argc, char* argv[])
|
|||||||
|
|
||||||
auto delta = system_clock::now() - start;
|
auto delta = system_clock::now() - start;
|
||||||
auto delta_d = duration_cast<duration<double>> (delta).count();
|
auto delta_d = duration_cast<duration<double>> (delta).count();
|
||||||
logger cout_logger ("", sinks::stdout_sink());
|
|
||||||
cout_logger.info("Total:") << format(howmany);
|
cout_logger.info("Total:") << format(howmany);
|
||||||
cout_logger.info("Delta:") << format(delta_d);
|
cout_logger.info("Delta:") << format(delta_d);
|
||||||
cout_logger.info("Rate:") << format(howmany/delta_d) << "/sec";
|
cout_logger.info("Rate:") << format(howmany/delta_d) << "/sec";
|
||||||
|
Loading…
Reference in New Issue
Block a user