bench # threads can be passed at cmd line as first arg

This commit is contained in:
gabime
2014-11-04 02:30:48 +02:00
parent 5d3025322f
commit 29d1790f98
4 changed files with 17 additions and 7 deletions

View File

@@ -2,14 +2,15 @@
#include "spdlog/spdlog.h"
int main(int, char*[])
int main(int argc, char* argv[])
{
int howmany = 1000000;
namespace spd = spdlog;
///Create a file rotating logger with 5mb size max and 3 rotated files
auto logger = spd::rotating_logger_mt("file_logger", "logs/spd-sample", 10 *1024 * 1024 , 5);
logger->set_pattern("[%Y-%b-%d %T.%e]: %v");
for(int i = 0 ; i < 1000000; ++i)
for(int i = 0 ; i < howmany; ++i)
logger->info() << "spdlogger message #" << i;
return 0;