-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.cpp
More file actions
44 lines (36 loc) · 1.01 KB
/
Copy pathlogger.cpp
File metadata and controls
44 lines (36 loc) · 1.01 KB
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
// logger.cpp
#include "logger.hpp"
#include "const.hpp"
#include <iostream>
using namespace std;
Logger::Logger(string program) : program_(move(program)) {}
void Logger::minfo(const string &msg)
{
string buf = CYAN_COLOR + "[INF:" + program_ + "] " + RESET_COLOR + msg + '\n';
cerr << buf;
}
void Logger::ginfo(const string &msg)
{
string buf = MAGENTA_COLOR + "[INF:" + program_ + "] " + RESET_COLOR + msg + '\n';
cerr << buf;
}
void Logger::cinfo(const string &msg)
{
string buf = YELLOW_COLOR + "[INF:" + program_ + "] " + RESET_COLOR + msg + '\n';
cerr << buf;
}
void Logger::warning(const string &msg)
{
string buf = YELLOW_COLOR + "[WARN:" + program_ + "] " + RESET_COLOR + msg + '\n';
cerr << buf;
}
void Logger::error(const string &msg)
{
string buf = RED_COLOR + "[ERR:" + program_ + "] " + RESET_COLOR + msg + '\n';
cerr << buf;
}
void Logger::output(const string &msg)
{
string buf = GREEN_COLOR + "[OUT:" + program_ + "] " + RESET_COLOR + msg + '\n';
cerr << buf;
}