From dcd9beac2e8c5558457b2434bc04af824a0d1578 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Wed, 15 Nov 2023 08:52:59 -0500 Subject: [PATCH] fix test logging --- flow/e2e/snowflake/peer_flow_sf_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flow/e2e/snowflake/peer_flow_sf_test.go b/flow/e2e/snowflake/peer_flow_sf_test.go index 13efa18e75..d2af00d9a0 100644 --- a/flow/e2e/snowflake/peer_flow_sf_test.go +++ b/flow/e2e/snowflake/peer_flow_sf_test.go @@ -97,6 +97,13 @@ func (s *PeerFlowE2ETestSuiteSF) setupTemporalLogger() { s.SetLogger(tlogger) } +type logWriterType struct{ t *testing.T } + +func (l logWriterType) Write(p []byte) (n int, err error) { + l.t.Logf(string(p)) + return len(p), nil +} + func (s *PeerFlowE2ETestSuiteSF) SetupSuite() { err := godotenv.Load() if err != nil { @@ -107,6 +114,7 @@ func (s *PeerFlowE2ETestSuiteSF) SetupSuite() { log.SetReportCaller(true) log.SetLevel(log.WarnLevel) + log.SetOutput(logWriterType{t: s.T()}) s.setupTemporalLogger()