Skip to content

[Feat] 在所有出错的地方打印error日志 #1062

Open

Description

@RikaCelery

很多插件的处理方式为

if err != nil {
	ctx.SendChain(message.Text("ERROR: ", err))
	return
}

在没有堆栈信息的时候不好调试错误,希望改为如下形式

if err != nil {
	log.Error("<插件名称>",err)
        ctx.SendChain(message.Text("ERROR: ", err))
	return
}

Activity

  1. EatHatsuneShallots commented on Nov 10, 2024

    @EatHatsuneShallots
    Contributor

    貌似可以添加一个新 API:ctx.SendErrorMesssge

  2. fumiama commented on Nov 10, 2024

    @fumiama
    Member

    可以加到ctxext。在控制台打印error和直接发送error效果相同,只要你把每个error的位置搞清楚肯定能知道哪里出了问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions