写文件

read.h

#include 
std::ofstream logging_;

read.cpp

#include 
#define LOG_PATH "../stdlog/digger.log"
logging_.open(LOG_PATH, std::ios::trunc);//存在则清空,不存在则新建
logging_ << "log_init_ok" << std::endl;
logging_.close();

你可能感兴趣的:(写文件)