forked from githole/Live-Coder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.h
More file actions
52 lines (39 loc) · 740 Bytes
/
Logger.h
File metadata and controls
52 lines (39 loc) · 740 Bytes
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
#include <string>
#ifndef _LOGGER_
#define _LOGGER_
#include <vector>
#include <iostream>
namespace LiveCoder {
class Logger {
private:
std::vector<std::string> logs;
public:
void PushString(std::string str) {
logs.push_back(str);
}
void OutputString(std::string str) {
std::cout << str << std::endl;
logs.push_back(str);
}
std::string ToString() {
std::string str;
for (int i = 0; i < logs.size(); i ++)
str += logs[i] + "\n";
return str;
}
void Save(void) {
// ...
}
static Logger* Instance() {
static Logger instance; // —Bˆê‚̃Cƒ“ƒXƒ^ƒ“ƒX
return &instance;
}
Logger(const Logger& rhs) {};
Logger& operator=(const Logger& rhs) {};
Logger() {
}
virtual ~Logger() {
}
};
};
#endif