
参考博文:C++ 命令行解析包 gflags 使用详解
例:
代码
#include
#include
#include
using namespace std;
int main(int argc, char **argv) {
FLAGS_logtostderr = false;
string log_path = "你的保存的log路径";
google::SetLogDestination(google::GLOG_INFO, log_path.c_str());
google::InitGoogleLogging("glog_test");
LOG(INFO) << "Main(): Start glog_learn" << std::endl;
google::ShutdownGoogleLogging();
return 0;
}
编译
g++ test.cpp -o test -lglog
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)