Skip to content

Commit

Permalink
Merge pull request #98 from tendermint/bugfix/97-unexpected-log-level
Browse files Browse the repository at this point in the history
parse log level using tmlibs/cli/flags package (Fixes #97)
  • Loading branch information
melekes authored Jun 2, 2017
2 parents 9a9a3a7 + 20ce43e commit 6f7a436
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
7 changes: 2 additions & 5 deletions cmd/commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/tendermint/abci/server"
eyes "github.com/tendermint/merkleeyes/client"
"github.com/tendermint/tmlibs/cli"
cliflags "github.com/tendermint/tmlibs/cli/flags"
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"

"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/node"
Expand Down Expand Up @@ -139,13 +139,10 @@ func startTendermint(dir string, basecoinApp *app.Basecoin) error {
return err
}

// TODO: parse the log level from the config properly (multi modules)
// but some tm code must be refactored for better usability
lvl, err := log.AllowLevel(cfg.LogLevel)
tmLogger, err := cliflags.ParseLogLevel(cfg.LogLevel, logger, config.DefaultConfig().LogLevel)
if err != nil {
return err
}
tmLogger := log.NewFilter(logger, lvl)

// Create & start tendermint node
privValidator := types.LoadOrGenPrivValidator(cfg.PrivValidatorFile(), tmLogger)
Expand Down
42 changes: 20 additions & 22 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import:
- rpc/lib/types
- types
- package: github.com/tendermint/tmlibs
version: develop
subpackages:
- cli
- common
Expand Down

0 comments on commit 6f7a436

Please sign in to comment.