all: imp code

This commit is contained in:
Dimitry Kolyshev 2025-07-07 17:53:37 +04:00
parent 88b5398c8b
commit 081526039f
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ const (
UpstreamTypeService = "service"
// UpstreamTypeTest is the log attribute value for upstreams used for
// testing.
// testing and validation.
UpstreamTypeTest = "test"
)

View File

@ -10,6 +10,7 @@ import (
"slices"
"strings"
"github.com/AdguardTeam/AdGuardHome/internal/aghslog"
"github.com/AdguardTeam/AdGuardHome/internal/filtering"
"github.com/AdguardTeam/dnsproxy/proxy"
"github.com/AdguardTeam/dnsproxy/upstream"
@ -143,7 +144,7 @@ func (c *Persistent) validate(ctx context.Context, l *slog.Logger, allTags []str
}
conf, err := proxy.ParseUpstreamsConfig(c.Upstreams, &upstream.Options{
Logger: slogutil.NewDiscardLogger(),
Logger: l.With(aghslog.KeyUpstreamType, aghslog.UpstreamTypeTest),
})
if err != nil {
return fmt.Errorf("invalid upstream servers: %w", err)