Skip to content

Commit

Permalink
Fixed garbled logging messages in PG connector
Browse files Browse the repository at this point in the history
Some of the messages were using the non-formatted output with a
formatting string which was creating pretty unreadable logging output so
these have been fixed now.
  • Loading branch information
sgnn7 committed Apr 9, 2020
1 parent 69b1ade commit 2fd6b3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/plugin/connectors/tcp/pg/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (s *SingleUseConnector) ConnectToBackend() error {
return err
}

s.logger.Debugln(
s.logger.Debugf(
"Successfully connected to '%s:%s'",
s.connectionDetails.Host,
s.connectionDetails.Port,
Expand Down
6 changes: 3 additions & 3 deletions internal/plugin/connectors/tcp/pg/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Startup performs the startup handshake with the client and parses the client
// options to extract the database name.
func (s *SingleUseConnector) Startup() error {
s.logger.Debugln("Handling connection %v", s.clientConn)
s.logger.Debugf("Handling connection %+v -> %+v", s.clientConn.RemoteAddr(), s.clientConn.LocalAddr())

messageBytes, err := protocol.ReadStartupMessage(s.clientConn)
if err != nil {
Expand All @@ -21,8 +21,8 @@ func (s *SingleUseConnector) Startup() error {
return err
}

s.logger.Debugln(
"s.Client version : %v, (SSL mode: %v)",
s.logger.Debugf(
"s.Client version: %v, (SSL mode: %v)",
version,
version == protocol.SSLRequestCode)

Expand Down

0 comments on commit 2fd6b3e

Please sign in to comment.