github.com/blend/go-sdk@v1.20220411.3/envoyutil/main_test.go (about)

     1  /*
     2  
     3  Copyright (c) 2022 - Present. Blend Labs, Inc. All rights reserved
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file.
     5  
     6  */
     7  
     8  package envoyutil_test
     9  
    10  import (
    11  	"bytes"
    12  
    13  	"github.com/blend/go-sdk/logger"
    14  )
    15  
    16  // InMemoryLog creates a logger that logs to the in-memory buffer passed in.
    17  func InMemoryLog(logBuffer *bytes.Buffer) logger.Log {
    18  	return logger.MustNew(
    19  		logger.OptAll(),
    20  		logger.OptOutput(logBuffer),
    21  		logger.OptFormatter(logger.NewTextOutputFormatter(
    22  			logger.OptTextNoColor(),
    23  			logger.OptTextHideTimestamp(),
    24  		)),
    25  	)
    26  }