Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log: show the matching rule tag #3809

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Log: show the matching rule tag #3809

merged 1 commit into from
Sep 13, 2024

Conversation

Fangliding
Copy link
Member

For #3311
加一个子命令是不太可能了 但是可以选择在log中输出命中的规则
翻了一下代码之后发现一个似乎没人用文档也没写的 “ruleTag” 项 不如用起来
现在如果设置了 “ruleTag” 在hit中这个rule的时候便会显示这个tag名 用于调试
效果如图
image

@Fangliding Fangliding changed the title Rule tag 在Log中显示命中的tag名 Sep 13, 2024
@Fangliding Fangliding changed the title 在Log中显示命中的tag名 在Log中显示命中的rule名 Sep 13, 2024
@@ -80,16 +80,16 @@ func (r *Router) Init(ctx context.Context, config *Config, d dns.Client, ohm out
}

// PickRoute implements routing.Router.
func (r *Router) PickRoute(ctx routing.Context) (routing.Route, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return 3 个有点难看 加到 routing.Route 里?或者直接改成返回 rule?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看起来是个好主意 已经放到routing.Route里了

@yuhan6665 yuhan6665 changed the title 在Log中显示命中的rule名 Log: show the matching rule tag Sep 13, 2024
@yuhan6665 yuhan6665 merged commit 7970f24 into main Sep 13, 2024
36 checks passed
@yuhan6665
Copy link
Member

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants