- func NewLogger(t testing.TB) *logrus.Logger
- func NewTestOutput(t testing.TB) io.Writer
- func SetEnv(t *testing.T, newEnv string) (restoreEnv func())
- type SimpleLogrusHook
NewLogger Returns new logger that will log to the testing.TB.Logf
func NewTestOutput ¶
NewTestOutput returns a simple io.Writer implementation that uses the test's logger as an output.
SetEnv is a helper funcion for setting arbitrary environment variables and restoring the old ones at the end, usually by deferring the returned callback TODO: remove these hacks when we improve the configuration (hopefully completely, see https://github.com/loadimpact/k6/issues/883)... we shouldn't have to mess with the global environment at all...
type SimpleLogrusHook ¶
SimpleLogrusHook implements the logrus.Hook interface and could be used to check if log messages were outputted
Drain returns the currently stored messages and deletes them from the cache
Fire saves whatever message the logrus library passed in the cache