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 details)

Uploaded Source

File details

Details for the file ZypUtility-0.1.3.tar.gz.

File metadata

  • Download URL: ZypUtility-0.1.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for ZypUtility-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9e6d6f7fb1fc9d634f573396f64fb3ce938caeb116dbd1781096641bb33ba2a2
MD5 cdff53d10345ed003b9813b85f132aca
BLAKE2b-256 5efb6bd50a17488efe671d7f60e0d85b4922fc47a28d3ef864b5da74879a261e

See more details on using hashes here.

Supported by

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