Skip to main content

simple log configuration

Project description

pysimple-Log

概要

使用 logging 进行封装了一下 日志格式进行封装, 同时使用 concurrent_log_handler 来完成多进程安全的写日志

安装

Install and update using pip:

pip install pysimple-log

快速开始

from simplelog import logger  

logger.info("this is test")
logger.error("this is test")

定制化logger

    import logging
    from  simplelog import  Logger
    log = Logger(name='test',filename='app.log',level=logging.DEBUG)

    logger = log.get_logger()

    logger.debug("this is test")
    logger.warning("this is test")
    logger.info("this is test")
    logger.error("this is test")
    logger.exception("this is test")

结果如下:

[2020-03-06 22:53:57 WARNING/33060] test <input>:<module>:9 this is test
[2020-03-06 22:53:57 INFO/33060] test <input>:<module>:10 this is test
[2020-03-06 22:53:57 ERROR/33060] test <input>:<module>:11 this is test
[2020-03-06 22:53:57 ERROR/33060] test <input>:<module>:12 this is test
NoneType: None

贡献

如果你对这个项目感兴趣,非常欢迎可以一起维护这个项目。 如果你在使用的过程发现什么问题,可以联系我。

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

pysimple-log-0.0.3.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pysimple_log-0.0.3-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

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