nim_duilib/examples/proto_debuger/loger.h
2021-11-22 23:53:21 +08:00

45 lines
998 B
C++

//
// Created by bt110 on 2019/8/19.
//
#ifndef CPP11FEATURETEST_LOGER_H
#define CPP11FEATURETEST_LOGER_H
#include <stdio.h>
#include <string>
#include <time.h>
#include <fstream>
#include <iostream>
using namespace std;
namespace Loger{
typedef enum Mode{
Mode_Daily, // 每天保存一次日志
MODE_Monthly, // 每个月保存一次日志
MODE_Weekly // 每周保存一次日志
}ESaveMode;
typedef class _C_Loger {
private:
string mCurrentPath;
FILE *mFile; // 日志文件
ESaveMode mMode; // 工作模式
string mCurrentDate; // 当天
int error;
public:
_C_Loger(FILE *p);
_C_Loger(string path);
#define DEBUG_FILE_POSITION __FILE__,__LINE__
int Debug(string,string,int);
int Log();
int LogFile();
void operator+(const string&);
void operator<<(const string&);
}Loger;
}
#endif //CPP11FEATURETEST_LOGER_H