mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-28 09:09:35 +08:00
bench and examples updates
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
int main(int, char* [])
|
||||
{
|
||||
int howmany = 1000000;
|
||||
int howmany = 1048576;
|
||||
namespace spd = spdlog;
|
||||
spd::set_async_mode(howmany);
|
||||
///Create a file rotating logger with 5mb size max and 3 rotated files
|
||||
@@ -14,5 +14,9 @@ int main(int, char* [])
|
||||
for(int i = 0 ; i < howmany; ++i)
|
||||
logger->info() << "spdlog message #" << i << ": This is some text for your pleasure";
|
||||
|
||||
|
||||
//because spdlog async logger waits for the back thread logger to finish all messages upon destrcuting,
|
||||
//and we want to measure only the time it took to push those messages to the backthread..
|
||||
abort();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -14,10 +14,10 @@ int main(int argc, char* argv[])
|
||||
if(argc > 1)
|
||||
thread_count = atoi(argv[1]);
|
||||
|
||||
int howmany = 1000000;
|
||||
int howmany = 1048576;
|
||||
|
||||
namespace spd = spdlog;
|
||||
spd::set_async_mode(howmany, std::chrono::seconds(0));
|
||||
spd::set_async_mode(howmany);
|
||||
///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);
|
||||
|
||||
@@ -45,5 +45,7 @@ int main(int argc, char* argv[])
|
||||
t.join();
|
||||
};
|
||||
|
||||
return 0;
|
||||
//because spdlog async logger waits for the back thread logger to finish all messages upon destrcuting,
|
||||
//and we want to measure only the time it took to push those messages to the backthread..
|
||||
abort();
|
||||
}
|
||||
|
Reference in New Issue
Block a user