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.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for pysimple_log-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c695ce4f368f097472a869de9dc3f1125e17b66b970e99289561bc4733c427d |
|
MD5 | 923630b7e35fdb64cd785022d73aadba |
|
BLAKE2b-256 | 47d47548f616527be8fbb39d5996548de47c06959928f570fa33a3d88393dc50 |