diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/connection.go | 10 | ||||
-rw-r--r-- | core/log.go | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/core/connection.go b/core/connection.go index 67c7e1d..02f980a 100644 --- a/core/connection.go +++ b/core/connection.go @@ -174,8 +174,7 @@ func (c *Connection) connectVPP() error { if err := c.vppClient.Connect(); err != nil { return err } - - log.Debugf("Connected to VPP.") + log.Debugf("Connected to VPP") if err := c.retrieveMessageIDs(); err != nil { c.vppClient.Disconnect() @@ -202,7 +201,12 @@ func (c *Connection) Disconnect() { // disconnectVPP disconnects from VPP in case it is connected. func (c *Connection) disconnectVPP() { if atomic.CompareAndSwapUint32(&c.vppConnected, 1, 0) { - c.vppClient.Disconnect() + log.Debug("Disconnecting from VPP..") + + if err := c.vppClient.Disconnect(); err != nil { + log.Debugf("Disconnect from VPP failed: %v", err) + } + log.Debug("Disconnected from VPP") } } diff --git a/core/log.go b/core/log.go index aaef4cc..035c159 100644 --- a/core/log.go +++ b/core/log.go @@ -18,6 +18,7 @@ func init() { log.Out = os.Stdout if debug { log.Level = logger.DebugLevel + log.Debugf("debug mode enabled") } } |