Add template.log

This commit is contained in:
Neko Ayaka 2024-05-06 14:12:19 +08:00 committed by 世界
parent 954ee213c9
commit 2c4472a571
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@
// Global
"log": {},
"domain_strategy": "",
"disable_traffic_bypass": false,
"disable_rule_set": false,
@ -81,6 +82,10 @@
Profile name.
#### log
Log configuration, see [Log](https://sing-box.sagernet.org/configuration/log/).
#### domain_strategy
Global sing-box domain strategy.

View File

@ -12,6 +12,7 @@ type Template struct {
// Global
Log *option.LogOptions `json:"log,omitempty"`
DomainStrategy option.DomainStrategy `json:"domain_strategy,omitempty"`
DisableTrafficBypass bool `json:"disable_traffic_bypass,omitempty"`
DisableRuleSet bool `json:"disable_rule_set,omitempty"`

View File

@ -41,6 +41,7 @@ type ExtraGroup struct {
func (t *Template) Render(metadata M.Metadata, profileName string, outbounds [][]boxOption.Outbound, subscriptions []*subscription.Subscription) (*boxOption.Options, error) {
var options boxOption.Options
options.Log = t.Log
err := t.renderDNS(metadata, &options)
if err != nil {
return nil, E.Cause(err, "render dns")