#include <memory>
#include <onepiece/datacore/DataCore.h>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <memory>
using namespace std;
int main(int argc, const char *argv[]) {
// test spdlog.
cout << "ワンピース は 実在する." << endl;
auto logger = std::make_shared<spdlog::logger>("LoggerTest", std::make_shared<spdlog::sinks::basic_file_sink_mt>("testLog.csv"));
logger->info("test info message...");
logger->warn("test warn message..");
logger->error("test error message...");
// 试试拼接格式
string tangqizhe = "tangqizhe";
string hudehui= "hudehui";
int value = 1;
double dvalue = 3.14;
logger->info("test info message {0} - {1}...", tangqizhe.c_str(), hudehui.c_str()); // ok
logger->info("test info message {0} - {1}...", value, dvalue); // ok
return 0;
}
标签:info,...,示例,demo,spdlog,test,message,include,logger
From: https://blog.51cto.com/u_9527606/8103588