-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcutelog.cpp
97 lines (86 loc) · 2.52 KB
/
cutelog.cpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <stdlib.h>
#include <iostream>
bool lightMode = false;
void error(const char* message) {
if (lightMode == false) {
std::cout << "\u001b[41m\u001b[37;1mERROR :" << "\u001b[40m\u001b[0m " << message << " \n";
}
else if (lightMode == true) {
std::cout << "\u001b[41m\u001b[37;1mERROR :" << "\u001b[47;1m\u001b[38;5;0m " << message << " \n";
}
}
void errorMultiLine(const char* message) {
if (lightMode == false) {
std::cout << "\u001b[41m\u001b[37;1m " << "\u001b[40m\u001b[0m " << message << " \n";
}
else if (lightMode == true) {
std::cout << "\u001b[41m\u001b[37;1m " << "\u001b[47;1m\u001b[38;5;0m " << message << " \n";
}
}
void infoMultiline(const char* message)
{
if (lightMode == false) {
std::cout << "\u001b[46;1m\u001b[37;1m " << "\u001b[40m\u001b[0m " << message << " \n";
}
else if (lightMode == true) {
std::cout << "\u001b[46;1m\u001b[37;1m " << "\u001b[47;1m\u001b[38;5;0m " << message << " \n";
}
}
void info(const char* message)
{
if (lightMode == false) {
std::cout << "\u001b[46;1m\u001b[37;1mINFO :" << "\u001b[40m\u001b[0m " << message << " \n";
}
else if (lightMode == true) {
std::cout << "\u001b[46;1m\u001b[37;1mINFO :" << "\u001b[47;1m\u001b[38;5;0m " << message << " \n";
}
}
void warning(const char* message) {
if (lightMode == false) {
std::cout << "\u001b[43;1m\u001b[37;1mWARNING:" << "\u001b[40m\u001b[0m " << message << " \n";
}
else if (lightMode == true) {
std::cout << "\u001b[43;1m\u001b[37;1mWARNING:" << "\u001b[47;1m\u001b[38;5;0m " << message << " \n";
}
}
void warningMultline(const char* message) {
if (lightMode == false) {
std::cout << "\u001b[43;1m\u001b[37;1m " << "\u001b[40m\u001b[0m " << message << " \n";
}
else if (lightMode == true) {
std::cout << "\u001b[43;1m\u001b[37;1m " << "\u001b[47;1m\u001b[38;5;0m " << message << " \n";
}
}
void toggleToLightMode() {
lightMode = true;
}
void toggleToDarkMode() {
lightMode = false;
}
void cuteLogExample() {
error("Dark");
info("Dark");
warning("Dark");
toggleToLightMode();
error("Light");
info("Light");
warning("Light");;
toggleToDarkMode();
error("Dark");
errorMultiLine("Dark");
info("Dark");
infoMultiline("Dark");
warning("Dark");
warningMultline("Dark");
toggleToLightMode();
error("Light");
errorMultiLine("Light");
info("Light");
infoMultiline("Light");
warning("Light");
warningMultline("Light");
}
int main()
{
cuteLogExample();
}