Documentation ¶
Index ¶
- type TestLogger
- func (tl *TestLogger) Debug(args ...interface{})
- func (tl *TestLogger) Debugf(format string, args ...interface{})
- func (tl *TestLogger) Info(args ...interface{})
- func (tl *TestLogger) Infof(format string, args ...interface{})
- func (tl *TestLogger) IsDebugEnabled() bool
- func (tl *TestLogger) SetNTBForTest(t testing.NTB)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestLogger ¶
type TestLogger struct {
// contains filtered or unexported fields
}
TestLogger wraps testing.NTB to add optional debug logging, without exposing the ability to error or fatally terminate the test.
func (*TestLogger) Debug ¶
func (tl *TestLogger) Debug(args ...interface{})
Debug only prints the log message if debug is enabled. Use for verbose logs that can be enabled by developers, but won't show in CI.
func (*TestLogger) Debugf ¶
func (tl *TestLogger) Debugf(format string, args ...interface{})
Debugf only prints the log message, with Sprintf-like formatting, if debug is enabled. Use for verbose logs that can be enabled by developers, but won't show in CI.
func (*TestLogger) Info ¶
func (tl *TestLogger) Info(args ...interface{})
Info prints the message to the test log.
func (*TestLogger) Infof ¶
func (tl *TestLogger) Infof(format string, args ...interface{})
Infof prints the message to the test log, with Sprintf-like formatting.
func (*TestLogger) IsDebugEnabled ¶
func (tl *TestLogger) IsDebugEnabled() bool
IsDebugEnabled returns true if debug is enabled for this test
func (*TestLogger) SetNTBForTest ¶ added in v1.16.0
func (tl *TestLogger) SetNTBForTest(t testing.NTB)
SetNTBForTest sets the loggers NTB for the scope of a test. This ensures that for shared test environments, the actual test's logger is used for the scope of the test. This ensures proper interleaving of logs when running tests in parallel. Reset to the original logger after the test for post-test logging.