github.com/weaviate/weaviate@v1.24.6/test/helper/logger.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package helper
    13  
    14  import "testing"
    15  
    16  // Internal struct to link the HTTP client logging of the Weaviate API client to the test's logging output.
    17  
    18  type testLogger struct {
    19  	t *testing.T
    20  }
    21  
    22  func (tl *testLogger) Printf(format string, args ...interface{}) {
    23  	tl.t.Logf("HTTP LOG:\n"+format, args...)
    24  }
    25  
    26  func (tl *testLogger) Debugf(format string, args ...interface{}) {
    27  	tl.t.Logf("HTTP DEBUG:\n"+format, args...)
    28  }