Comments (6)
message.py:78
elif event.type == "meta_event":
log_msg += f"MetaEvent {event.raw_event}"
logger.opt(colors=True).info(log_msg)
希望可以将元事件进行隐藏
from nonebot2.
希望也可以隐藏以下信息
logger.debug(f"Checking for matchers in priority {priority}...")
results = await asyncio.gather(*pending_tasks, return_exceptions=True)
from nonebot2.
- 心跳包这个你可以在开发环境调整心跳间隔,例如30s一次
- 这个info信息后续可以做简略调整
- 由于是debug模式,所以为了方便用户定位响应事件的优先级,所以打印了这行日志
from nonebot2.
啊……
对于3,我是希望将心跳包的优先级DEBUG信息进行隐藏。个人认为心跳包之类的元事件应当由nonebot框架处理,不应该涉及插件操作,相关INFO信息也可以省略。
目前我对message.py进行了如下调整,至少对于我来说效果不错……
async def handle_event(bot: Bot, event: Event):
log_msg = f"<m>{bot.type.upper()} </m>| {event.self_id} [{event.name}]: "
show_log = True
elif event.type == "meta_event":
log_msg += f"MetaEvent {event.raw_event}"
show_log = False
if show_log:
logger.opt(colors=True).info(log_msg)
pending_tasks = [
_run_matcher(matcher, bot, event, state.copy())
for matcher in matchers[priority]
]
if show_log:
logger.debug(f"Checking for matchers in priority {priority}...")
from nonebot2.
@yanyongyu 或者还有一种办法,把部分日志挪到trace等级?
from nonebot2.
removed in dev
from nonebot2.
Related Issues (20)
- Plugin: nonebot-plugin-yinying-chat HOT 1
- Plugin: nonebot-plugin-yinying-chat HOT 4
- Plugin: Yinying-Chat HOT 38
- Plugin: 职场日历 HOT 7
- Adapter: Kritor HOT 1
- Plugin: Yinying-Chat HOT 1
- Plugin: QQ频道-Discord 互通 HOT 1
- Plugin: 战双表情 HOT 5
- Plugin: nonebot-plugin-sanyao HOT 1
- Plugin: nonebot-plugin-sanyao HOT 1
- Plugin: nonebot-plugin-sanyao HOT 2
- Plugin: nonebot-plugin-sanyao HOT 2
- Plugin: 三爻易数 HOT 7
- Plugin: cyberfurry HOT 6
- Plugin: HelpWithPic HOT 6
- Plugin: 表情包保存器 HOT 1
- Plugin: 番剧下载 HOT 4
- Adapter: Tailchat HOT 2
- Plugin: with_ai_agents HOT 6
- Plugin: 神秘学助手 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nonebot2.