Skip to main content

在使用 nonebot 自带的 logger 写入 ERROR 级别以上的日志时,会自动发送至钉钉机器人

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-dingtalk-logger

✨ 将错误日志推送至钉钉机器人的 NoneBot 插件 ✨

license pypi python

📖 介绍

在使用 nonebot 自带的 logger 写入 ERROR 级别以上的日志时,会自动发送至钉钉机器人

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-dingtalk-logger
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-dingtalk-logger
pdm
pdm add nonebot-plugin-dingtalk-logger
poetry
poetry add nonebot-plugin-dingtalk-logger
conda
conda install nonebot-plugin-dingtalk-logger

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_dingtalk_logger"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
DINGTALK_TOKEN 调用接口的凭证,钉钉提供的 Webhook 链接中 access_token 的值
DINGTALK_SECRET "" 安全密钥,安全设置项选择了加签后,提供的 SEC 开头的字符串
DINGTALK_KEYWORDS [] 自定义关键词,创建机器人时在安全设置项填入的所有关键词
DINGTALK_TIMEOUT -1 全局请求超时时间,值为正时生效

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

nonebot_plugin_dingtalk_logger-0.0.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file nonebot_plugin_dingtalk_logger-0.0.2.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_dingtalk_logger-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ebb81a5e080cd338e1706fc8a2ee70ff721cf549084c0f6e5fcf45ff254c511b
MD5 94d49ca52079116bf18cb367ee7b96d6
BLAKE2b-256 f8d467b9110457192d3289a47b0078886266527b300fa3ced3c6976c714798d2

See more details on using hashes here.

File details

Details for the file nonebot_plugin_dingtalk_logger-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_dingtalk_logger-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4d33b5bff3a3e4a3cb781c0578197406ab6bdba3b709ec33efbd9e7f815ee68
MD5 e78cdd5485b4675c1faaaeecb5536899
BLAKE2b-256 c4f700bf9fa2084b5b853fa2553581f72ceff41338e5aa93525cf90fdb72ad59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page