Skip to content
Snippets Groups Projects
Commit 99ba412ea469 authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

TestLogger: add a SetTB function that (temporarily) changes the current TB

parent e09c0f536372
No related branches found
No related tags found
No related merge requests found
Pipeline #7591 passed
......@@ -34,6 +34,16 @@
return len(m), nil
}
// SetTB changes the current TB, and returns a function to get back to the
// previous one
func (tl *TestLogger) SetTB(tb testing.TB) func() {
otb := tl.tb
tl.tb = tb
return func() {
tl.tb = otb
}
}
// GetLogger returns a test Logger
func GetLogger(tb testing.TB) zerolog.Logger {
return NewTestLogger(tb).Logger()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment