Skip to main content

-- coding: UTF-8 --

##Version: 0.0.1 日志模板 目前仅支持自定义消息处理 使用log请直接再文件中导入 from luckylog import Logger 如需要保存为文件,则需要导入整个文件获取全局变量 import logger 执行:Logger.sccess(xxx) 文件中有两个全局变量,当设置 path 为保存的文件位置和格式,module为选择保存的类型 module = 'success,error,warning,tip' 目前有四种类型的日志消息 目前展示类型:运行时间、函数名称、文件路径、状态、行数,格式固定,固定调用即显示 success:成功; error:错误; warning:警告; tip:提示;

添加装饰器功能: 装饰器使用: from luckylog import logger (注意是小写的l) 装饰器自带两个参数,success和fail,代表自定义的成功和失败自定义消息 使用:在需要使用的def放上 @logger(success=xxx,fail=xxx) 如果不定义消息,则默认成功为--Success,失败为--Fail 使用装饰器后可不用带异常错误处理 装饰器不能用在类class上,可能出现报错而日志显示成功的情况

增设全局变量debug_file,当debug_file传入文件路径时(包含文件本身及格式),系统将判断函数执行正确性,失败则将报错写入路径中的文件 函数运行成功将不会保存并写入文件 debug_file保存内容:运行事件,函数名称,文件路径,报错信息 !!!!!debug_file的保存文件方式,目前仅支持 @logger() 装饰器形式的启用!!!!!

v1.0.0

Logger改为元组形式,可输入不限定参数 装饰器增加Debug模式,from luckylog import luckylog luckylog.Debug = True 可开启debug模式,默认关闭状态 Debug模式开启,使用装饰器,成功增加返回输入参数,失败增加返回参数和异常报错信息 Arguments/Exception 错误日志增加输入参数

v1.0.3

1、修改书写错误worning改成warning,以前写法仍旧可用 2、修改书写错误erro改成error,方法名替换

v1.0.4

1、修复装饰器使用不能获取返回值的bug

v 2.0.0版本:

改动: 1、部分文字错误进行了修改 2、增加了日志文件跳转,在pycharm等编辑器上可以直接点击跳转页面 3、使用log_conf代替原来分散的日志配置,使用log_conf来进行统一管理,日志类型以列表形式传入 4、logger装饰器修改形参名为passed、failed 5、logger开放参数deep,默认为1,为当前调用深度,本身为0,调用一次为1,可自行设置 6、日志书写模式不再支持键值对方式,即Logger(test='测试')的形式 7、更改debug_file配置名称为error_file更贴近文件意义 8、修改Debug变量名称为detail,区别于debugger,为显示错误日志详细信息 9、增加debug功能,对函数详细步骤进行解析

Release files for luckylog 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luckylog 2.0.3
File Size Uploaded
luckylog-2.0.3.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for luckylog 2.0.3
File Interpreter ABI Platform
luckylog-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / luckylog-2.0.3.tar.gz

Download URL luckylog-2.0.3.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fed3c8be55771f9132e7c734f04781b539df4ab8c968f293bd7cd58dfaf4a8ff
BLAKE2b-256 checksum
How to use checksums
e9bb3cc997d5ed85143d3964bde11972d41015bbf7267a1f9c7f71184491d5cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

Release files / luckylog-2.0.3-py3-none-any.whl

Download URL luckylog-2.0.3-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea0181a94bb3fe67002f5366fd0844c693bfe13e0075d3bd2f0ac31a919bdb9e
BLAKE2b-256 checksum
How to use checksums
fe20d495340912d0704b4f59ce7a37f7c5f19d0f2cbf4c48257eed6d1e0c4f52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page