util.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:uicourses_v2 作者: sumerinlan 项目源码 文件源码
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
###############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号