Skip to main content

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

feishu_logging_handler-1.0.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

feishu_logging_handler-1.0.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file feishu_logging_handler-1.0.3.tar.gz.

File metadata

File hashes

Hashes for feishu_logging_handler-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b62a665097c72a9191983b7fcd5583a069e580dcaf7c7e1cb596154c93ee377c
MD5 3f9904af8712554dc637d2fa621f47d8
BLAKE2b-256 f7c4ab137e3de037556d439db747aaf6a576c92414a1ea81dd7f4b397fb24035

See more details on using hashes here.

File details

Details for the file feishu_logging_handler-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for feishu_logging_handler-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9e83babd9cd99a51b2726360f12f903df83c9072811b3644c4f9976dca0bea8a
MD5 8ff48770a9909cd35af69ed52290a37d
BLAKE2b-256 35fb463f8db40e2242489fd8e326fd4c302c48faaf578ff663f07670c9c7c9f7

See more details on using hashes here.

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