Skip to content

Commit 8a99cbc

Browse files
committed
Improve logging
1 parent 9fe21e4 commit 8a99cbc

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

cli/cmd/autologin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package cmd
22

33
import (
4+
"fmt"
45
"halsecur/cli"
56
"halsecur/cli/bisecur"
6-
"fmt"
77
"time"
88

99
"github.com/spf13/cobra"
@@ -43,8 +43,9 @@ func autoLogin(cmd *cobra.Command, args []string) error {
4343
if err != nil {
4444
return fmt.Errorf("failed to auto login. %v", err)
4545
}
46+
} else {
47+
cli.Log.Debugf("Token is still valid.")
4648
}
4749

48-
cli.Log.Debugf("Token is still valid.")
4950
return nil
5051
}

cli/cmd/login.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package cmd
22

33
import (
4+
"fmt"
45
"halsecur/cli"
56
"halsecur/cli/bisecur"
67
"halsecur/cli/utils"
7-
"fmt"
88
"os"
99
"time"
1010

@@ -49,7 +49,7 @@ func loginCmdFunc() error {
4949
return err
5050
}
5151

52-
cli.Log.Infof("Token: 0x%X", token)
52+
cli.Log.Infof("New token: 0x%X", token)
5353

5454
// Store token in persistent config
5555
viper.Set(ArgNameToken, token)

0 commit comments

Comments
 (0)