diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-22 20:10:07 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-23 18:16:44 +0800 |
commit | d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 (patch) | |
tree | 17c93170551d3eeabe2935de1765f157007f0dc2 /cmd/ethtest | |
parent | 47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff) | |
download | go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst go-tangerine-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip |
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'cmd/ethtest')
-rw-r--r-- | cmd/ethtest/main.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/cmd/ethtest/main.go b/cmd/ethtest/main.go index 14b839579..a107c701f 100644 --- a/cmd/ethtest/main.go +++ b/cmd/ethtest/main.go @@ -25,7 +25,7 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/tests" "gopkg.in/urfave/cli.v1" @@ -70,7 +70,7 @@ var ( ) func runTestWithReader(test string, r io.Reader) error { - glog.Infoln("runTest", test) + log.Info(fmt.Sprint("runTest", test)) var err error switch strings.ToLower(test) { case "bk", "block", "blocktest", "blockchaintest", "blocktests", "blockchaintests": @@ -92,7 +92,7 @@ func runTestWithReader(test string, r io.Reader) error { } func getFiles(path string) ([]string, error) { - glog.Infoln("getFiles", path) + log.Info(fmt.Sprint("getFiles", path)) var files []string f, err := os.Open(path) if err != nil { @@ -113,7 +113,7 @@ func getFiles(path string) ([]string, error) { // only go 1 depth and leave directory entires blank if !v.IsDir() && v.Name()[len(v.Name())-len(testExtension):len(v.Name())] == testExtension { files[i] = filepath.Join(path, v.Name()) - glog.Infoln("Found file", files[i]) + log.Info(fmt.Sprint("Found file", files[i])) } } case mode.IsRegular(): @@ -134,7 +134,7 @@ func runSuite(test, file string) { } for _, curTest := range tests { - glog.Infoln("runSuite", curTest, file) + log.Info(fmt.Sprint("runSuite", curTest, file)) var err error var files []string if test == defaultTest { @@ -149,11 +149,11 @@ func runSuite(test, file string) { files, err = getFiles(file) } if err != nil { - glog.Fatalln(err) + log.Crit(fmt.Sprint(err)) } if len(files) == 0 { - glog.Warningln("No files matched path") + log.Warn("No files matched path") } for _, curFile := range files { // Skip blank entries @@ -163,16 +163,16 @@ func runSuite(test, file string) { r, err := os.Open(curFile) if err != nil { - glog.Fatalln(err) + log.Crit(fmt.Sprint(err)) } defer r.Close() err = runTestWithReader(curTest, r) if err != nil { if continueOnError { - glog.Errorln(err) + log.Error(fmt.Sprint(err)) } else { - glog.Fatalln(err) + log.Crit(fmt.Sprint(err)) } } } @@ -190,14 +190,14 @@ func setupApp(c *cli.Context) error { runSuite(flagTest, flagFile) } else { if err := runTestWithReader(flagTest, os.Stdin); err != nil { - glog.Fatalln(err) + log.Crit(fmt.Sprint(err)) } } return nil } func main() { - glog.SetToStderr(true) + log.Root().SetHandler(log.StreamHandler(os.Stderr, log.TerminalFormat())) app := cli.NewApp() app.Name = "ethtest" @@ -216,7 +216,7 @@ func main() { } if err := app.Run(os.Args); err != nil { - glog.Fatalln(err) + log.Crit(fmt.Sprint(err)) } } |