Completed
Push — master ( f3706d...d90139 )
by Mingyu
15s
created

app.misc.log.log()   A

Complexity

Conditions 4

Size

Total Lines 7
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 7
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
from termcolor import colored
2
3
4
def log(message: str, type: str="WARN"):
5
    if type == "WARN":
6
        print(colored('[WARN]', 'yellow'), message)
7
    elif type == "ERROR":
8
        print(colored('[ERROR] ' + message, 'red'))
9
    elif type == "INFO":
10
        print(colored('[INFO]', 'blue'), message)
11