-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlog.cpp
More file actions
38 lines (29 loc) · 707 Bytes
/
Copy pathlog.cpp
File metadata and controls
38 lines (29 loc) · 707 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
#include <string>
#include <iostream>
#include <map>
#include "allyes-log.h"
#include "LogSys.h"
using namespace std;
static const char* s_LogLevelNames[LOG_LEVEL_MAX] = {
"DEBUG",
"INFO",
"WARNING",
"ERROR",
};
const char* get_log_level_txt(ENUM_LOG_LEVEL level) {
if (level < LOG_LEVEL_MAX) {
return s_LogLevelNames[level];
}
else {
return "UNKNOWN";
}
}
bool LOG_SYS_INIT(const string& config_file) {
return LogSys::getInstance().initialize(config_file);
}
void LOG_OUT(const string& log, ENUM_LOG_LEVEL level) {
LogSys::getInstance().log(log, level);
}
void LOG_SET_LEVEL(ENUM_LOG_LEVEL level) {
LogSys::getInstance().setLevel(level);
}