-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.py
More file actions
64 lines (53 loc) · 1.7 KB
/
logger.py
File metadata and controls
64 lines (53 loc) · 1.7 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#Credits to Mistium for the logger which is from OriginChats.
class Colors:
RESET = '\033[0m'
BOLD = '\033[1m'
RED = '\033[91m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
BLUE = '\033[94m'
MAGENTA = '\033[95m'
CYAN = '\033[96m'
WHITE = '\033[97m'
GRAY = '\033[90m'
class Logger:
@staticmethod
def add(message: str):
"""Log an addition/creation action"""
print(f"{Colors.GREEN}[+]{Colors.RESET} {message}")
@staticmethod
def get(message: str):
"""Log a retrieval/query action"""
print(f"{Colors.BLUE}[?]{Colors.RESET} {message}")
@staticmethod
def info(message: str):
"""Log general information"""
print(f"{Colors.CYAN}[i]{Colors.RESET} {message}")
@staticmethod
def warning(message: str):
"""Log warnings"""
print(f"{Colors.YELLOW}[!]{Colors.RESET} {message}")
@staticmethod
def error(message: str):
"""Log errors"""
print(f"{Colors.RED}[ERROR]{Colors.RESET} {message}")
@staticmethod
def success(message: str):
"""Log success messages"""
print(f"{Colors.GREEN}[✓]{Colors.RESET} {message}")
@staticmethod
def like(message: str):
"""Log like action"""
print(f"{Colors.MAGENTA}[♥]{Colors.RESET} {message}")
@staticmethod
def cont(message: str):
"""Log continue action"""
print(f"{message}")
@staticmethod
def search(message: str):
"""Log search action"""
print(f"{Colors.BLUE}[i]{Colors.RESET} {message}")
@staticmethod
def delete(message: str):
"""Log delete action"""
print(f"{Colors.RED}[🗑]{Colors.RESET} {message}")