From 02830e0ad62e6bfa6467580d13858aa7e106e8a6 Mon Sep 17 00:00:00 2001 From: Skyxim Date: Sat, 19 Nov 2022 23:07:05 +0800 Subject: [PATCH] fix: adjust log --- dns/doh.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dns/doh.go b/dns/doh.go index 02cf63e8..413ede66 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -354,7 +354,7 @@ func (doh *dnsOverHTTPS) getClient(ctx context.Context) (c *http.Client, isCache func (doh *dnsOverHTTPS) createClient(ctx context.Context) (*http.Client, error) { transport, err := doh.createTransport(ctx) if err != nil { - return nil, fmt.Errorf("initializing http transport: %w", err) + return nil, fmt.Errorf("[%s] initializing http transport: %w", doh.url.String(), err) } client := &http.Client{ @@ -392,11 +392,11 @@ func (doh *dnsOverHTTPS) createTransport(ctx context.Context) (t http.RoundTripp // upstream. transportH3, err := doh.createTransportH3(ctx, tlsConfig, dialContext) if err == nil { - log.Debugln("using HTTP/3 for this upstream: QUIC was faster") + log.Debugln("[%s] using HTTP/3 for this upstream: QUIC was faster", doh.url.String()) return transportH3, nil } - log.Debugln("using HTTP/2 for this upstream: %v", err) + log.Debugln("[%s] using HTTP/2 for this upstream: %v", doh.url.String(), err) if !doh.supportsHTTP() { return nil, errors.New("HTTP1/1 and HTTP2 are not supported by this upstream")