ColorInfo 是一个使用Python3编写的简单的彩色日志工具,拥有简单、友好的语法
Project description
ColorInfo
介绍
ColorInfo 是一个使用Python3编写的简单的彩色日志工具,主要特性:
- 使用简单
- 彩色输出
- 中文注释
- 支持全部Python3版本(>=3.0)
更新内容
1.1.6
- 增加
set_level
函数,可按需设置最低记录等级 - 设置私有函数
def set_level(self, console="DEBUG", text="DEBUG"):
"""
设置显示等级,当实际等级低于设置等级的时候将不会显示/写入
:param console: 设置控制台显示最低等级
:param text: 设置文本记录最低等级
:return:
"""
self.level_console = self.level_dic[console.upper()]
self.level_text = self.level_dic[text.upper()]
安装教程
执行下面的命令即可
pip3 install ColorInfo
Demo
# -*- encoding: utf-8 -*-
"""
@File : demo.py
@Time : 2022-10-26 23:51
@Author : 坐公交也用券
@Version : 1.0
@Contact : liumou.site@qq.com
@Homepage : https://liumou.site
@Desc : 演示
"""
from ColorInfo import ColorLogger
log = ColorLogger(txt=True, fileinfo=True, basename=False)
log.info(msg='1', x="23")
log.error('2', '22', '222')
log.debug('3', '21')
log.warning('4', '20', 22)
效果
请在gitee
项目主页查看图片
项目主页
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ColorInfo-1.1.6.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for ColorInfo-1.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e2a708642de7d71fb2bbf1109de0fed05c6ff40ad297561da1bd29eb382679c |
|
MD5 | 5d76f70e4c54cc47aae131b1c643929c |
|
BLAKE2b-256 | bfda0030b49c128cd1fd0ec85ea8c04c7d7fe3253c397f5f87406021b38285c0 |