Project logging printout
Project description
loguru-notification
loguru-notification 是一个日志输出项目,在loguru的基础集成日志输出到控制台、输出到Slack、并结合CMRESHandler把日记记录到ElasticSearch, 更容易的对日志进行分析。
Installation
1.使用python包管理工具pip 进行安装。
pip install loguru-notification
Usage
对loguru-notification进行配置,并输出日志信息。
from configlog.setlogs import Logger
logger = Logger(
webhook_url='Your Slack webhook URL', # Slack webhook URL # noqa
es_host='172.0.0.1:9200', # log on ElasticSearch host ip and port
)
if __name__ == '__main__':
logger.printout('输出到控制台')
logger.msg('输出到控制台,并写入ElasticSearch')
logger.notice('输出到控制台和Slack,并写入ElasticSearch')
Contributing
欢迎使用,如果有好的优化方法也欢迎提交修改。
使用前请做适当的测试,以确定跟您的项目完全兼容。
License
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
Built Distribution
File details
Details for the file loguru-notification-0.0.7.tar.gz
.
File metadata
- Download URL: loguru-notification-0.0.7.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f76549fdecb1786d858d57b38ecda3344aff9bf311db836bc74d11401dcc348a |
|
MD5 | 2e56077ec298046a2e81198e8981f924 |
|
BLAKE2b-256 | 0a8ba6dd34e14474652049f13857f90baf877b56451f8d28da24d88ddb163ffd |
File details
Details for the file loguru_notification-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: loguru_notification-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2c18494964b4b09d3a29fca9ef036846dc0a86751e7c37dad1225b288bdb269 |
|
MD5 | 4893aaaeffb7284542c5fbd3ed99d1ac |
|
BLAKE2b-256 | 6ca0c53bfae1778c807613742c400cd8399bfd9b4c77c8dadaf26aa20c095be2 |