diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-03-02 21:06:16 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2017-03-02 21:06:16 +0800 |
commit | 9184249b393e4e332ae6a2f5d774880a88a9bfd6 (patch) | |
tree | 7788ce54cb04d1af4fe03ab3c2447354bcaac3cc /cmd/swarm/hash.go | |
parent | 82e7c1d1241737fd0ae9b25e0f20857b8597b148 (diff) | |
download | dexon-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.gz dexon-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.zst dexon-9184249b393e4e332ae6a2f5d774880a88a9bfd6.zip |
Logger updates 3 (#3730)
* accounts, cmd, eth, ethdb: port logs over to new system
* ethdb: drop concept of cache distribution between dbs
* eth: fix some log nitpicks to make them nicer
Diffstat (limited to 'cmd/swarm/hash.go')
-rw-r--r-- | cmd/swarm/hash.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go index bcba77a2a..792e8d0d7 100644 --- a/cmd/swarm/hash.go +++ b/cmd/swarm/hash.go @@ -19,9 +19,9 @@ package main import ( "fmt" - "log" "os" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/storage" "gopkg.in/urfave/cli.v1" ) @@ -29,12 +29,11 @@ import ( func hash(ctx *cli.Context) { args := ctx.Args() if len(args) < 1 { - log.Fatal("Usage: swarm hash <file name>") + utils.Fatalf("Usage: swarm hash <file name>") } f, err := os.Open(args[0]) if err != nil { - fmt.Println("Error opening file " + args[1]) - os.Exit(1) + utils.Fatalf("Error opening file " + args[1]) } defer f.Close() @@ -42,7 +41,7 @@ func hash(ctx *cli.Context) { chunker := storage.NewTreeChunker(storage.NewChunkerParams()) key, err := chunker.Split(f, stat.Size(), nil, nil, nil) if err != nil { - log.Fatalf("%v\n", err) + utils.Fatalf("%v\n", err) } else { fmt.Printf("%v\n", key) } |