From b81555beeac8eda71e8150cc9d63631aaa756965 Mon Sep 17 00:00:00 2001 From: "Rune T. Aune" Date: Sat, 21 Nov 2015 14:28:18 -0600 Subject: [PATCH] Fix "Established connection" log message. Don't log "Established connection" message on new when DisableConnectOnNew is set and no connection was actually established. Do log that same message when Connect() successfully connects. --- infrastructure.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infrastructure.go b/infrastructure.go index 673bd8a8..df3d6766 100644 --- a/infrastructure.go +++ b/infrastructure.go @@ -1211,8 +1211,6 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error start = true } } - log.Infof("Established connection to RPC server %s", - config.Host) client := &Client{ config: config, @@ -1230,6 +1228,8 @@ func New(config *ConnConfig, ntfnHandlers *NotificationHandlers) (*Client, error } if start { + log.Infof("Established connection to RPC server %s", + config.Host) close(connEstablished) client.start() if !client.config.HTTPPostMode && !client.config.DisableAutoReconnect { @@ -1282,6 +1282,8 @@ func (c *Client) Connect(tries int) error { // Connection was established. Set the websocket connection // member of the client and start the goroutines necessary // to run the client. + log.Infof("Established connection to RPC server %s", + c.config.Host) c.wsConn = wsConn close(c.connEstablished) c.start()