logging的飞书handler
Project description
feishu-logging-handler
通过webhook将自定义服务的消息推送至飞书
特点:
- 异步有可能会遇到loop已释放的问题,调整为同步。启用多线程,所以性能ok
安装
pip install feishu-logging-handler
配置
- 创建一个飞书群组
- 点击群设置,添加一个机器人,并生成Webhook地址
- 可以设置关键词过滤
使用方式
初始化:
from feishu_logging.handler import FeiShuWebhookHandler
log_feishu = logging.getLogger("feishu")
http_handler = FeiShuWebhookHandler("https://open.feishu.cn/open-apis/bot/v2/hook/xxx","key_word")
http_handler.setLevel(logging.DEBUG)
log_feishu.addHandler(http_handler)
写日志:
log_feishu = logging.getLogger("feishu")
log_feishu.error("错误测试")
填入Webhook地址和关键词(或项目名称)即可
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 feishu_logging_handler-1.0.3.tar.gz
.
File metadata
- Download URL: feishu_logging_handler-1.0.3.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62a665097c72a9191983b7fcd5583a069e580dcaf7c7e1cb596154c93ee377c |
|
MD5 | 3f9904af8712554dc637d2fa621f47d8 |
|
BLAKE2b-256 | f7c4ab137e3de037556d439db747aaf6a576c92414a1ea81dd7f4b397fb24035 |
File details
Details for the file feishu_logging_handler-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: feishu_logging_handler-1.0.3-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e83babd9cd99a51b2726360f12f903df83c9072811b3644c4f9976dca0bea8a |
|
MD5 | 8ff48770a9909cd35af69ed52290a37d |
|
BLAKE2b-256 | 35fb463f8db40e2242489fd8e326fd4c302c48faaf578ff663f07670c9c7c9f7 |