From a8d1c2fd2451725378b8bf8cdff7c8c1eeab0bdc Mon Sep 17 00:00:00 2001 From: lifenjoiner Date: Tue, 21 Feb 2023 23:24:11 +0800 Subject: [PATCH] `dlog.SetLogLevel(dlog.SeverityDebug)` if `go test -v` (#2331) --- dnscrypt-proxy/sources_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dnscrypt-proxy/sources_test.go b/dnscrypt-proxy/sources_test.go index 5e52455e..f3e41b9e 100644 --- a/dnscrypt-proxy/sources_test.go +++ b/dnscrypt-proxy/sources_test.go @@ -14,9 +14,9 @@ import ( "time" "github.com/hectane/go-acl" - "github.com/powerman/check" - + "github.com/jedisct1/dlog" "github.com/jedisct1/go-minisign" + "github.com/powerman/check" ) type SourceFixture struct { @@ -382,6 +382,10 @@ func setupSourceTestCase(t *testing.T, d *SourceTestData, i int, } func TestNewSource(t *testing.T) { + if testing.Verbose() { + dlog.SetLogLevel(dlog.SeverityDebug) + dlog.UseSyslog(false) + } teardown, d := setupSourceTest(t) defer teardown() checkResult := func(t *testing.T, e *SourceTestExpect, got *Source, err error) { @@ -443,6 +447,10 @@ func TestNewSource(t *testing.T) { } func TestPrefetchSources(t *testing.T) { + if testing.Verbose() { + dlog.SetLogLevel(dlog.SeverityDebug) + dlog.UseSyslog(false) + } teardown, d := setupSourceTest(t) defer teardown() checkResult := func(t *testing.T, expects []*SourceTestExpect, got time.Duration) {