diff --git a/cmd/root.go b/cmd/root.go index 7d601d6f..80c811a6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -75,7 +75,7 @@ func initFuncs(cmd *cobra.Command, args []string) { } -func database(cmd *cobra.Command, args []string) { +func database() { ipc = viper.GetString("client.ipcpath") levelDbPath = viper.GetString("client.leveldbpath") storageDiffsPath = viper.GetString("filesystem.storageDiffsPath") @@ -89,12 +89,15 @@ func database(cmd *cobra.Command, args []string) { viper.Set("database.config", databaseConfig) } -func logLevel(cmd *cobra.Command, args []string) error { +func logLevel() error { lvl, err := log.ParseLevel(viper.GetString("log.level")) if err != nil { return err } log.SetLevel(lvl) + if lvl > log.InfoLevel { + log.SetReportCaller(true) + } log.Info("Log level set to ", lvl.String()) return nil } diff --git a/environments/infura.toml b/environments/infura.toml index fb9876fb..5e1f06b5 100644 --- a/environments/infura.toml +++ b/environments/infura.toml @@ -4,4 +4,4 @@ port = 5432 [client] - ipcPath = "" + ipcPath = "https://kovan.infura.io/v3/be5f83b248b74b34890cbf76e0945e29" diff --git a/main.go b/main.go index 7d94fd94..e9da333f 100644 --- a/main.go +++ b/main.go @@ -3,15 +3,15 @@ package main import ( "github.com/vulcanize/vulcanizedb/cmd" - log "github.com/sirupsen/logrus" "os" + + log "github.com/sirupsen/logrus" ) func main() { log.SetFormatter(&log.JSONFormatter{ PrettyPrint: true, }) - log.SetReportCaller(true) file, err := os.OpenFile("vulcanizedb.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) if err == nil {