-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMLog.h
52 lines (39 loc) · 1.13 KB
/
MLog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef _MLOG_H
#define _MLOG_H
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#define LOGSZ 500
//Warning Codes:
//0 = MS/MS Spectrum is centroid, but parameter is profile
typedef struct mWarning {
int count;
std::string msg;
} mWarning;
class MLog {
public:
MLog();
void addError(std::string msg);
void addDBWarning(std::string msg);
void addMessage(std::string msg, bool silent = false);
void addParameter(std::string msg);
void addParameterWarning(std::string msg);
void addWarning(size_t id, std::string msg);
void clear();
void exportLog();
void setDBinfo(std::string fn, int prot, int pep, int adduct);
void setLog(char* fn);
void setLog(std::string fn);
private:
size_t idIndex[LOGSZ]; //room for defined number of unique warning messages
std::string dbInfo;
std::string logFile;
std::vector<std::string> vDBWarnings; //special log for database;
std::vector<std::string> vMsg;
std::vector<std::string> vParams; //special log for params;
std::vector<std::string> vParamWarnings; //special log for params;
std::vector<mWarning> vWarnings;
std::string strError;
};
#endif