Add subCommand name to log fields

This commit is contained in:
Andrew J Yao
2019-07-23 08:09:57 -07:00
parent d7a82e353b
commit 92d153b010
12 changed files with 90 additions and 82 deletions
+2 -2
View File
@@ -150,11 +150,11 @@ func initConfig() {
}
}
func getBlockChain() *geth.BlockChain {
func getBlockChain(subCommand string) *geth.BlockChain {
rawRpcClient, err := rpc.Dial(ipc)
if err != nil {
log.Fatal("Could not dial client: ", err)
log.WithField("subCommand", subCommand).Fatal(err)
}
rpcClient := client.NewRpcClient(rawRpcClient, ipc)
ethClient := ethclient.NewClient(rawRpcClient)