Documentation ¶
Index ¶
Constants ¶
const (
LogLevelEnvVar = "TEST_LOG_LEVEL"
)
Variables ¶
var (
L zerolog.Logger
)
Functions ¶
func GetLogger ¶
GetLogger returns a logger that will write to the testing.T.Log function using the env var provided for the log level. nil can be passed for t to get a logger that is not associated with a go test.
func GetTestContainersGoTestLogger ¶
GetTestContainersGoTestLogger returns a logger that will write to the testing.T.Log function using the env var for log level for logs that testcontainers-go will log out. nil can be passed to this and it will be treated as the default tc.Logger
func GetTestLogger ¶
GetTestLogger returns a logger that will write to the testing.T.Log function using the env var for log level. nil can be passed for t to get a logger that is not associated with a go test.
func SplitStringIntoChunks ¶
SplitStringIntoChunks takes a string and splits it into chunks of a specified size.
Types ¶
type CustomT ¶
CustomT wraps testing.T for two purposes: 1. it implements Write to override the default logger 2. it implements Printf to implement the testcontainers-go/Logging interface The reason for both of these is that go parallel testing causes the logs to get mixed up, so we need to override the default logger to *testing.T.Log to ensure that the logs are properly associated with the tests running. The testcontainers-go/Logging interface complicates this more since it needs a struct with L to hold the logger and needs to override Printf.