krypticlogger是一个工具,可以帮助更好地组织和最小化日志记录时的代码量!
KrypticLogger的Python项目详细描述
氪星工作室-氪星记录器
krypticlogger是一个工具,可以帮助更好地组织和最小化日志记录时的代码量!
安装
- PIP安装
pip install KrypticLogger
或
- 将存储库克隆到项目文件夹。
$ git clone https://github.com/KrypticStudio/KrypticLogger
- 安装要求
$ pip install -r requirements.txt
- 安装setup.py
$ python3 setup.py install
用法
- 导入氪星记录器!
fromKrypticLoggerimportlog#as logimportKrypticLoggeraslogPath
- 随便叫它!
#### Set path for log filelogPath.path="Logs/log.txt"### Parameters# tag = "EXAMPLE" #Customize the notifier tag. ##ONLY AVAILABLE FOR CUSTOM# log = True #Logs to terminal or cmd.# write = False #Writes log to file# time = False #Adds current time to log# code = "0x00" #Custime code for error, organization, etc...# critical = False #Displays weather the message is critical or not.log.custom(tag,message,log=True,write=False,time=False,code="",critical=False)
- 示例
# ExamplefromKrypticLoggerimportlogimportKrypticLoggeraslogPath# Setting Log Path(Optional) ***DEFAULT "log.txt"logPath.path="Logs/log.txt"#Message to be displayed...Message="Kryptic Studio Test. Kryptic Logger"# Calling Logslog.debug(Message)log.error(Message)log.info(Message)log.log(Message)log.success(Message)log.track(Message)log.warn(Message)log.custom("Custom Tag",Message)
贡献
欢迎拉取请求。对于重大变更,请先打开一个问题来讨论您希望更改的内容。
请确保根据需要更新测试。