Skip to content

Commit

Permalink
Merge pull request #64 from quorumcontrol/feature/moar-logs
Browse files Browse the repository at this point in the history
add a few helpful INFO logs for community support
  • Loading branch information
Brandon Westcott authored Apr 7, 2020
2 parents 2c5787e + 76e6601 commit 9ae0bb8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"runtime"
"strings"

logging "github.com/ipfs/go-log"
Expand All @@ -21,13 +22,20 @@ var rootCmd = &cobra.Command{

func Execute() {
setLogLevel()
globalDebugLogs()

if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}

func globalDebugLogs() {
log.Infof("dgit version: " + Version)
log.Infof("goos: " + runtime.GOOS)
log.Infof("goarch: " + runtime.GOARCH)
}

func setLogLevel() {
// turn off all logging, mainly for silencing tupelo-go-sdk ERROR logs
logging.SetAllLoggers(logging.LevelPanic)
Expand Down
7 changes: 6 additions & 1 deletion keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import (
keyringlib "github.com/99designs/keyring"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
logging "github.com/ipfs/go-log"
)

var log = logging.Logger("dgit.keyring")

type Keyring interface {
keyringlib.Keyring
}
Expand All @@ -35,12 +38,14 @@ var keyName = "default"
var ErrKeyNotFound = keyringlib.ErrKeyNotFound

func NewDefault() (Keyring, error) {
return keyringlib.Open(keyringlib.Config{
kr, err := keyringlib.Open(keyringlib.Config{
ServiceName: "dgit",
KeychainTrustApplication: true,
KeychainAccessibleWhenUnlocked: true,
AllowedBackends: secureKeyringBackends,
})
log.Info("keyring provider: " + Name(kr))
return kr, err
}

func NewMemory() Keyring {
Expand Down

0 comments on commit 9ae0bb8

Please sign in to comment.