SetLogLevel sets the global log level for the execution of the current tb. Though setting the log level is safe for use from concurrent goroutines, it's not advised to use SetLogLevel in parallel tests/benchmark, i.e. using t.Parallel().
(tb testing.TB, level log.Level)
| 102 | // not advised to use SetLogLevel in parallel tests/benchmark, i.e. using |
| 103 | // t.Parallel(). |
| 104 | func SetLogLevel(tb testing.TB, level log.Level) { |
| 105 | cur := log.GetLevel() |
| 106 | log.SetLevel(level) |
| 107 | tb.Cleanup(func() { log.SetLevel(cur) }) |
| 108 | } |