44 lines
927 B
C
44 lines
927 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);
|
||
|
|
||
|
int Debug();
|
||
|
int Log();
|
||
|
int LogFile();
|
||
|
void operator+(const string&);
|
||
|
void operator<<(const string&);
|
||
|
}Loger;
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif //CPP11FEATURETEST_LOGER_H
|