forked from s045pd/DarkNet_ChineseTrading
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.py
32 lines (21 loc) · 600 Bytes
/
log.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
import logging
from termcolor import colored
from conf import Config
logging.basicConfig(format="[%(asctime)s]%(message)s", level=logging.INFO)
Loger = logging.getLogger("ChineseTradingNetwork")
def info(txt):
Loger.info(f"{colored(txt, 'blue')}")
return txt
def success(txt):
Loger.info(f"{colored(txt, 'green')}")
return txt
def warning(txt):
Loger.info(f"{colored(txt, 'yellow')}")
return txt
def error(txt):
Loger.info(f"{colored(txt, 'red')}")
return txt
def debug(txt):
if Config.debug:
Loger.info(f"{colored(txt,'cyan')}")
return txt