summaryrefslogtreecommitdiff
path: root/client/fsm.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-02-28 10:37:00 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2023-02-28 10:37:00 +0100
commit15cb268440b54bcbdcae9d64e1d5d083e99d74e7 (patch)
tree6450b9a01de01d8c85e8e2a25c525358b121b959 /client/fsm.go
parent1557593401acaca1bac696195794103fcda07538 (diff)
Log: Use a global logger instance
Diffstat (limited to 'client/fsm.go')
-rw-r--r--client/fsm.go9
1 files changed, 5 insertions, 4 deletions
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())
}
}