test: send testagent logs through testing.Logf (#6411)

This commit is contained in:
R.B. Boyer 2019-08-27 12:21:30 -05:00 committed by GitHub
parent 0c5409d172
commit 1b3d066f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import (
"github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/logger" "github.com/hashicorp/consul/logger"
"github.com/hashicorp/consul/sdk/freeport" "github.com/hashicorp/consul/sdk/freeport"
"github.com/hashicorp/consul/sdk/testutil"
"github.com/hashicorp/consul/sdk/testutil/retry" "github.com/hashicorp/consul/sdk/testutil/retry"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -149,7 +150,7 @@ func (a *TestAgent) Start(t *testing.T) *TestAgent {
logOutput := a.LogOutput logOutput := a.LogOutput
if logOutput == nil { if logOutput == nil {
logOutput = os.Stderr logOutput = testutil.TestWriter(t)
} }
agentLogger := log.New(logOutput, a.Name+" - ", log.LstdFlags|log.Lmicroseconds) agentLogger := log.New(logOutput, a.Name+" - ", log.LstdFlags|log.Lmicroseconds)