use logrus for logging

This commit is contained in:
Taka Goto
2018-11-21 10:14:11 -06:00
parent 128d20c9bf
commit e8be96a4e7
57 changed files with 79 additions and 83 deletions
+4 -5
View File
@@ -15,13 +15,12 @@
package cmd
import (
"fmt"
"log"
"os"
"time"
"github.com/ethereum/go-ethereum/rpc"
"github.com/mitchellh/go-homedir"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@@ -55,7 +54,7 @@ var rootCmd = &cobra.Command{
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
log.Fatal(err)
os.Exit(1)
}
}
@@ -102,7 +101,7 @@ func initConfig() {
} else {
home, err := homedir.Dir()
if err != nil {
fmt.Println(err)
log.Fatal(err)
os.Exit(1)
}
@@ -113,7 +112,7 @@ func initConfig() {
viper.AutomaticEnv()
if err := viper.ReadInConfig(); err == nil {
fmt.Printf("Using config file: %s\n\n", viper.ConfigFileUsed())
log.Printf("Using config file: %s\n\n", viper.ConfigFileUsed())
}
}