mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
bench update
This commit is contained in:
@@ -8,28 +8,21 @@
|
||||
#include "c11log/sinks/stdout_sinks.h"
|
||||
#include "c11log/sinks/file_sinks.h"
|
||||
using namespace std;
|
||||
using namespace c11log;
|
||||
|
||||
int main(int, char* [])
|
||||
|
||||
details::fast_oss f(const std::string& what)
|
||||
{
|
||||
details::fast_oss oss;
|
||||
oss << what;
|
||||
return oss;
|
||||
}
|
||||
int main_(int, char* [])
|
||||
{
|
||||
|
||||
auto console = c11log::factory::stdout_logger();
|
||||
auto file = c11log::factory::simple_file_logger("log.txt");
|
||||
auto rotating= c11log::factory::rotating_file_logger("myrotating", "txt", 1024*1024*5, 5, 1);
|
||||
auto daily = c11log::factory::daily_file_logger("dailylog", "txt", 1, "daily_logger");
|
||||
auto foss = f("test2");
|
||||
foss.str();
|
||||
|
||||
|
||||
//console->info() << "This is variadic ", " func, ", 123 << " YES";
|
||||
FFLOG_TRACE(console, "This is ", 1);
|
||||
|
||||
|
||||
file->info("Hello file log");
|
||||
rotating->info("Hello rotating log");
|
||||
daily->info("Hello daily log");
|
||||
|
||||
//multi sink logger: file + console
|
||||
auto sink1= std::make_shared<c11log::sinks::stdout_sink_mt>();
|
||||
auto sink2 = std::make_shared<c11log::sinks::daily_file_sink_mt>("rotating", "txt");
|
||||
c11log::logger combined("combined", { sink1, sink2 });
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user