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)
Built Distribution
Close
Hashes for pysimple_log-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545a4b25dc53e8b08e8bc821d9cf546b30ee8cd2381a5c26fc663b1a663fa587 |
|
MD5 | 5f8274d17e6d7a6b1217dccadf31f428 |
|
BLAKE2b-256 | 0dc6ec13d2a3929f32307e74bc5d50156f150651eb0069d2875f362b22b01e85 |