-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.cpp
More file actions
42 lines (32 loc) · 777 Bytes
/
Logger.cpp
File metadata and controls
42 lines (32 loc) · 777 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
#include "Logger.hpp"
#include <string>
#include <iostream>
using namespace std;
using namespace std;
Logger& Logger::instance() {
static Logger logger_;
return logger_;
}
void Logger::setLogLevel(int level) {
this->LoggerLevel_ = level;
}
//[info] time xxxxxxxx
void Logger::log(std::string msg) {
switch (this->LoggerLevel_)
{
case INFO:
/* code */
cout << "[INFO] " << " : " << msg << endl;;
break;
case ERROR:
cout << "[ERROR] " << " : " << msg << endl;;
break;
case FATAL:
cout << "[FATAL] " << " : " << msg << endl;;
break;
case DEBUG:
cout << "[DEBUG] " << " : " << msg << endl;;
default:
break;
}
}