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