Skip to content

Commit

Permalink
refactor: make logs which doesn't effect test result to debug (keploy…
Browse files Browse the repository at this point in the history
…#1642)

Signed-off-by: Sarthak160 <[email protected]>
  • Loading branch information
Sarthak160 authored Mar 4, 2024
1 parent 4928947 commit 4b0bfa6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/proxy/integrations/postgresParser/postgres_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ func (p *PostgresParser) ProcessOutgoing(requestBuffer []byte, clientConn, destC
case models.MODE_RECORD:
err := encodePostgresOutgoing(requestBuffer, clientConn, destConn, p.hooks, p.logger, ctx)
if err != nil {
p.logger.Error("failed to encode the outgoing postgres call", zap.Error(err))
p.logger.Debug("failed to encode the outgoing postgres call", zap.Error(err))
}
case models.MODE_TEST:
logger := p.logger.With(zap.Any("Client IP Address", clientConn.RemoteAddr().String()), zap.Any("Client ConnectionID", util.GetNextID()), zap.Any("Destination ConnectionID", util.GetNextID()))
err := decodePostgresOutgoing(requestBuffer, clientConn, destConn, p.hooks, logger, ctx)
if err != nil {
logger.Error("failed to decode the outgoing postgres call", zap.Error(err))
if err != nil && !p.hooks.IsUserAppTerminateInitiated() {
logger.Debug("failed to decode the outgoing postgres call", zap.Error(err))
}
default:
p.logger.Info("Invalid mode detected while intercepting outgoing http call", zap.Any("mode", models.GetMode()))
Expand Down Expand Up @@ -506,7 +506,7 @@ func decodePostgresOutgoing(requestBuffer []byte, clientConn, destConn net.Conn,
logger.Debug("EOF error received from client. Closing connection in postgres !!")
return err
}
logger.Error("failed to read the request message in proxy for postgres dependency", zap.Error(err))
logger.Debug("failed to read the request message in proxy for postgres dependency", zap.Error(err))
return err
}
}
Expand Down

0 comments on commit 4b0bfa6

Please sign in to comment.