ResetGlobalTestLogging will ensure that the loggers are replaced at the end of the the test.
(t *testing.T)
| 595 | |
| 596 | // ResetGlobalTestLogging will ensure that the loggers are replaced at the end of the the test. |
| 597 | func ResetGlobalTestLogging(t *testing.T) { |
| 598 | t.Cleanup(func() { |
| 599 | for _, logger := range getFileLoggers() { |
| 600 | assert.NoError(t, logger.Close()) |
| 601 | } |
| 602 | ctx := TestCtx(t) |
| 603 | initializeLoggers(ctx) |
| 604 | SetUpGlobalTestLogging(ctx) |
| 605 | |
| 606 | }) |
| 607 | } |
| 608 | |
| 609 | // DisableTestLogging is an alias for SetUpTestLogging(LevelNone, KeyNone) |
| 610 | // This function will panic if called multiple times in the same test. |