From 2c4472a5717c8ac030162a791396cbbc732bda7b Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Mon, 6 May 2024 14:12:19 +0800 Subject: [PATCH] Add `template.log` --- docs/configuration/template.md | 5 +++++ option/template.go | 1 + template/template.go | 1 + 3 files changed, 7 insertions(+) diff --git a/docs/configuration/template.md b/docs/configuration/template.md index c930d42..e1ba259 100644 --- a/docs/configuration/template.md +++ b/docs/configuration/template.md @@ -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. diff --git a/option/template.go b/option/template.go index e497292..c018cd7 100644 --- a/option/template.go +++ b/option/template.go @@ -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"` diff --git a/template/template.go b/template/template.go index 831afa8..9bdc76a 100644 --- a/template/template.go +++ b/template/template.go @@ -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")