test: print api logs when UPTIME_TEST_LOG is set
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
4f57cafbdd
commit
f52ae33cf0
1 file changed
+3
@@ -82,6 +82,9 @@ func newEnvWith(t *testing.T, adjust func(*config.API)) *env {
|
||||
t.Fatal(err)
|
||||
}
|
||||
log := slog.New(slog.DiscardHandler)
|
||||
if os.Getenv("UPTIME_TEST_LOG") != "" {
|
||||
log = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug}))
|
||||
}
|
||||
|
||||
e := &env{dbPool: pool, rdb: rdb}
|
||||
r := platform.NewRouter(log)
|
||||
|
||||
Reference in new issue
Block a user