(t *testing.T, writer io.Writer)
| 46 | var servicesTestLogOutputMu sync.Mutex |
| 47 | |
| 48 | func withCapturedLogOutput(t *testing.T, writer io.Writer) { |
| 49 | t.Helper() |
| 50 | |
| 51 | servicesTestLogOutputMu.Lock() |
| 52 | cleanupRegistered := false |
| 53 | defer func() { |
| 54 | if !cleanupRegistered { |
| 55 | servicesTestLogOutputMu.Unlock() |
| 56 | } |
| 57 | }() |
| 58 | |
| 59 | currentOutput := log.DefaultLogger[*stdlog.Logger]().Logger().Writer() |
| 60 | t.Cleanup(func() { |
| 61 | log.SetOutput(currentOutput) |
| 62 | servicesTestLogOutputMu.Unlock() |
| 63 | }) |
| 64 | cleanupRegistered = true |
| 65 | |
| 66 | log.SetOutput(writer) |
| 67 | } |
| 68 | |
| 69 | func (*shutdownHookStorage) GetWithContext(context.Context, string) ([]byte, error) { |
| 70 | return nil, nil |
no test coverage detected