控制台应用程序的一种奇特的文本和日志工具
Console-Tools的Python项目详细描述
控制台工具
为服务器应用程序制作的用于格式化和日志记录的python模块
控制台工具:v0.2.1(稳定的ish-自0.2.0以来没有更新,只是重新打包)
包装:是
操作系统支持:操作系统独立
我是什么?
我们需要一个日志工具和控制台显示工具,有一个漂亮的彩色输出,所以我们很快就把这个结合起来了。
随着时间的推移,我们将实现其他功能,因为我们需要更多的东西在我们的控制台应用程序(主要功能是日志记录)。
所有日志都存储在logs/
日期-log.txt
使用一些基本的python知识,可以在install-location/consoleTools/core.py
中更改默认值。
用法
#Logging and displaying console outputfromconsoleToolsimportconsoleDisplayascdcd.log('e','I am an error')cd.log('w','I am a warning')cd.log('i','I am an informational message')cd.log('n',"I am a notice and therefore have no formatting as I'm not that important")cd.log('s','Woo-hoo! Your thing worked')
其他非主要项目:
- cd.clear()-清除控制台
- cd.print file()-打印文件内容
人们在制作时所问的问题(但不是用他们的语言)
q)我不想登录到文件
a)有一个默认为false的no logging标志,将其指定为true可禁用对文件的日志记录:
cd.log('s','I will not log to a file',True)
添加布尔标志True
,则不会将任何内容记录到文件中
q)我不想登录到logs/
。你为什么要我这么做
a)通过添加简单标志file="x"
,您可以登录到您想要的任何位置
cd.log('s','I will log to a custom file',file="thisfilecontainsthe.log")
我知道发生了什么事,但什么时候?
a)日志文件包含日期和时间-我们尽量保持控制台整洁
获取控制台工具
稳定
控制台工具很容易通过pip安装:
pip install Console-Tools
每晚
获取此版本(可能根本无法正常工作/工作正常)
git clone https://github.com/dudeisbrendan03/consoleTools.git
pip install -r requirements.txt
(可选)-全局访问模块:
将consoleTools
文件夹移到Python37\Lib\site-packages
β
我们上传一个beta(部分稳定)版本到pypi测试。
python -m pip install --index-url https://test.pypi.org/simple/ Console-Tools