def log(type='I', tag='', comment=''):
tag = tag[:8]
type = type[0]
fstr = '{type} {tag}{tagpad} {comment}'\
.format(type=type,
tag=tag, tagpad=' ' * (8 - len(tag)),
comment=comment)
color = None
if type.upper() == 'I':
color = 'cyan'
if type.upper() == 'C':
color = 'green'
if type.upper() == 'W':
color = 'magenta'
if type.upper() == 'E':
color = 'red'
if type.upper() == 'D':
color = 'yellow'
if color is not None:
fstr = colored(fstr, color)
print(fstr)
###############################################################################
# DATA FORMAT
###############################################################################
评论列表
文章目录