-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlogs.py
79 lines (48 loc) · 1.55 KB
/
logs.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import sys
from loguru import logger
logger.remove()
logger.add(
sys.stdout,
colorize=True,
enqueue=True,
format="<white>{time:YYYY-MM-DD HH:mm:ss}</white> | <level>{message}</level>",
)
head_text = """
_ ___ _ _____
| |/ (_) | ___ _____ __ | ___|_ _ _ __ _ __ ___ ___ _ __
| ' /| | |/ _ \ / _ \ \/ / | |_ / _` | '__| '_ ` _ \ / _ \ '__|
| . \| | | (_) | __/> < | _| (_| | | | | | | | | __/ |
|_|\_\_|_|\___/ \___/_/\_\ |_| \__,_|_| |_| |_| |_|\___|_|
____ _____ _ _______ ____ _ ___ ____ _ __
| _ \| ____| |/ /_ _| | __ )| | / _ \ / ___| |/ /
| |_) | _| | ' / | | | _ \| | | | | | | | ' /
| _ <| |___| . \ | | | |_) | |__| |_| | |___| . \\
|_| \_\_____|_|\_\ |_| |____/|_____\___/ \____|_|\_\\
_ _ ____ ____
| | / \ | __ ) ___|
| | / _ \ | _ \___ \\
| |___ / ___ \| |_) |__) |
|_____/_/ \_\____/____/
"""
bold = "\033[1m"
green = "\033[32m"
yellow = "\033[33m"
red = "\033[31m"
blue = "\033[34m"
grey = "\033[90m"
cyan = "\033[96m"
ml = "\033[95m"
reset = "\033[0m"
def color_position_type(position_type: str):
color = green if position_type == "LONG" else red
return f"{color}{position_type}{reset}"
def color_trading_pair(trading_pair: str):
return f"{blue}{trading_pair}{reset}"
def color_green(text: str):
return f"{green}{text}{reset}"
def color_cyan(text: str):
return f"{bold}{cyan}{text}{reset}"
def color_yellow(text: str):
return f"{yellow}{text}{reset}"
def color_ml(text: str):
return f"{ml}{text}{reset}"