cmd, internal, signer: split logs

This commit is contained in:
Kurkó Mihály 2019-04-25 14:10:27 +03:00
parent 8c4002c655
commit 88c6ffd066
3 changed files with 10 additions and 3 deletions

View file

@ -312,8 +312,11 @@ func accountCreate(ctx *cli.Context) error {
if err != nil { if err != nil {
utils.Fatalf("Failed to create account: %v", err) utils.Fatalf("Failed to create account: %v", err)
} }
fmt.Printf("Your new key is generated. Please backup the key file: %s\n", account.URL.Path) fmt.Printf("Your new key was generated\n")
fmt.Printf("Address: {%x}\n", account.Address) fmt.Printf("Address: {%x}\n", account.Address)
fmt.Printf("Please backup your key file!\n")
fmt.Printf("Path: {%s}\n", account.URL.Path)
fmt.Printf("Please remember your password!\n")
return nil return nil
} }

View file

@ -295,7 +295,9 @@ func (s *PrivateAccountAPI) DeriveAccount(url string, path string, pin *bool) (a
func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error) { func (s *PrivateAccountAPI) NewAccount(password string) (common.Address, error) {
acc, err := fetchKeystore(s.am).NewAccount(password) acc, err := fetchKeystore(s.am).NewAccount(password)
if err == nil { if err == nil {
log.Info("Your new key is generated. Please backup the key file", "path", acc.URL.Path) log.Info("Your new key was generated", "address", acc.Address)
log.Warn("Please backup your key file!", "path", acc.URL.Path)
log.Warn("Please remember your password!")
return acc.Address, nil return acc.Address, nil
} }
return common.Address{}, err return common.Address{}, err

View file

@ -392,7 +392,9 @@ func (api *SignerAPI) New(ctx context.Context) (common.Address, error) {
} else { } else {
// No error // No error
acc, err := be[0].(*keystore.KeyStore).NewAccount(resp.Text) acc, err := be[0].(*keystore.KeyStore).NewAccount(resp.Text)
log.Info("Your new key is generated. Please backup the key file", "path", acc.URL.Path) log.Info("Your new key was generated", "address", acc.Address)
log.Warn("Please backup your key file!", "path", acc.URL.Path)
log.Warn("Please remember your password!")
return acc.Address, err return acc.Address, err
} }
} }