//头文件log.h
#ifndef _LOG_H_
#define _LOG_H_
//声明类
class log{
public:
log(char* path);//构造函数
~log(void);//析构函数
int log_inf(char* str);
private:
char file[512];
};
#endif
//主文件log.cpp
#include "logs.h"
#include <ctime>
#include <fstream>
#include <iostream>
using namespace std;
//构造函数
log::log(char* path){
//检查文件是否存在,不存在就创建一个
ifstream f(path);
if(f.good()==0)
{
ofstream f;
f.open(path,ios::app);
f <<"===================================="<<endl<<endl;
f <<" 日志文件"<