From 15cb268440b54bcbdcae9d64e1d5d083e99d74e7 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 28 Feb 2023 10:37:00 +0100 Subject: Log: Use a global logger instance --- client/fsm.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'client/fsm.go') diff --git a/client/fsm.go b/client/fsm.go index e69652f..b2e846a 100644 --- a/client/fsm.go +++ b/client/fsm.go @@ -2,6 +2,7 @@ package client import ( "github.com/eduvpn/eduvpn-common/internal/fsm" + "github.com/eduvpn/eduvpn-common/internal/log" "github.com/eduvpn/eduvpn-common/internal/server" "github.com/go-errors/errors" ) @@ -247,7 +248,7 @@ func (c *Client) SetConnected() error { func (c *Client) SetConnecting() error { if c.InFSMState(StateConnecting) { // already loading connection, show no error - c.Logger.Warningf("Already connecting") + log.Logger.Warningf("Already connecting") return nil } if err := c.FSM.CheckTransition(StateConnecting); err != nil { @@ -271,7 +272,7 @@ func (c *Client) SetConnecting() error { func (c *Client) SetDisconnecting() error { if c.InFSMState(StateDisconnecting) { // already disconnecting, show no error - c.Logger.Warningf("Already disconnecting") + log.Logger.Warningf("Already disconnecting") return nil } if err := c.FSM.CheckTransition(StateDisconnecting); err != nil { @@ -296,7 +297,7 @@ func (c *Client) SetDisconnecting() error { func (c *Client) SetDisconnected() error { if c.InFSMState(StateDisconnected) { // already disconnected, show no error - c.Logger.Warningf("Already disconnected") + log.Logger.Warningf("Already disconnected") return nil } if err := c.FSM.CheckTransition(StateDisconnected); err != nil { @@ -320,7 +321,7 @@ func (c *Client) goBackInternal() { err := c.GoBack() if err != nil { // TODO(jwijenbergh): Bit suspicious - logging level INFO, yet stacktrace logged. - c.Logger.Infof("failed going back: %s\nstacktrace:\n%s", err.Error(), err.(*errors.Error).ErrorStack()) + log.Logger.Infof("failed going back: %s\nstacktrace:\n%s", err.Error(), err.(*errors.Error).ErrorStack()) } } -- cgit v1.2.3