(t *testing.T)
| 56 | } |
| 57 | |
| 58 | func TestLoggerCaching(t *testing.T) { |
| 59 | ctx := context.Background() |
| 60 | |
| 61 | loggerA, ctx := LoggerFor(ctx) |
| 62 | defer loggerA.Close() |
| 63 | defer os.Remove(loggerA.LogFile()) |
| 64 | |
| 65 | // Second call with same context returns the cached logger |
| 66 | loggerB, _ := LoggerFor(ctx) |
| 67 | |
| 68 | assert.Equal(t, loggerA, loggerB) |
| 69 | } |
| 70 | |
| 71 | func TestLoggerUniqueness(t *testing.T) { |
| 72 | ctxA := context.Background() |