-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logger.py
58 lines (50 loc) · 1.36 KB
/
Logger.py
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
class Logger:
HEADER = '\033[96m'
MAGENTA = '\033[95m'
CYAN = "\033[36m"
OK_GREEN = '\033[92m'
YELLOW = '\033[93m'
FAIL = '\033[91m'
END_C = '\033[0m'
BOLD = "\033[1m"
WARNING = "\033[33m"
@classmethod
def disable_color(cls):
cls.HEADER = ''
cls.MAGENTA = ''
cls.CYAN = ''
cls.OK_GREEN = ''
cls.YELLOW = ''
cls.FAIL = ''
cls.END_C = ''
cls.BOLD = ''
cls.WARNING = ''
@classmethod
def enable_color(cls):
cls.HEADER = '\033[96m'
cls.MAGENTA = '\033[95m'
cls.CYAN = "\033[36m"
cls.OK_GREEN = '\033[92m'
cls.YELLOW = '\033[93m'
cls.FAIL = '\033[91m'
cls.END_C = '\033[0m'
cls.BOLD = "\033[1m"
cls.WARNING = "\033[33m"
@classmethod
def info(cls, message):
print(cls.YELLOW + message + cls.END_C)
@classmethod
def header(cls, message):
print(cls.HEADER + message + cls.END_C)
@classmethod
def sub_info(cls, message):
print(cls.MAGENTA + message + cls.END_C)
@classmethod
def avail_info(cls, message):
print(cls.OK_GREEN + message + cls.END_C)
@classmethod
def warn(cls, message):
print(cls.WARNING + message + cls.END_C)
@classmethod
def err(cls, message):
print(cls.FAIL + str(message) + cls.END_C)