Skip to main content

zyputility contains readconfig & log

Project description

des:这是zhangyp自己的公用包,目前包含两个公用库ReadConfig(读取配置文件)、ZypLog(log类)
--ReadConfig
----读取配置文件,将配置文件信息转化成dict的形式,引用说明C = conf(),C['配置文件参数名']

--ZypLog
----将日志输出到控制台和保存在文件,设置如下
----def __init__(self, filename, level='info', when='D', back_count=3, fmt='''[时间]:%(asctime)s
[线程]:%(thread)s
[级别]:%(levelname)s
[路径]:%(pathname)s
[函数]:%(funcName)s
[行号]:%(lineno)d
[信息]:%(message)s
------------------
'''):
"""
:param filename: log名
:param level: bug等级
:param when: 时间间隔单位 S 秒、M 分、H 小时、D 天、W 星期、midnight 每天凌晨
:param back_count: log保留个数,如果超过这个个数,就会自动删除,
:param fmt: log格式化
"""
----如此引用 Logger('filename',level='info', when='D', back_count=3)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ZypUtility-0.1.3.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page