mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-03 08:31:20 +00:00
With must be called on log.filter, otherwise "main" entries get filtered
Also, we should allow "main" module to log INFO messages like ``` I[02-07|07:57:25.074] Found private validator module=main path=/home/vagrant/.tendermint/config/priv_validator.json I[02-07|07:57:25.076] Found genesis file module=main path=/home/vagrant/.tendermint/config/genesis.json ``` Refs https://github.com/cosmos/gaia/issues/118 **BEFORE**: ``` $ tendermint init ``` **AFTER**: ``` $ tendermint init I[02-07|07:57:25.074] Found private validator module=main path=/home/vagrant/.tendermint/config/priv_validator.json I[02-07|07:57:25.076] Found genesis file module=main path=/home/vagrant/.tendermint/config/genesis.json ```
This commit is contained in:
parent
bf84e82577
commit
b0ca8a0872
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
config = cfg.DefaultConfig()
|
config = cfg.DefaultConfig()
|
||||||
logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "main")
|
logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -57,6 +57,7 @@ var RootCmd = &cobra.Command{
|
|||||||
if viper.GetBool(cli.TraceFlag) {
|
if viper.GetBool(cli.TraceFlag) {
|
||||||
logger = log.NewTracingLogger(logger)
|
logger = log.NewTracingLogger(logger)
|
||||||
}
|
}
|
||||||
|
logger = logger.With("module", "main")
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -189,9 +189,10 @@ func DefaultLogLevel() string {
|
|||||||
return "error"
|
return "error"
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultPackageLogLevels returns a default log level setting so all packages log at "error", while the `state` package logs at "info"
|
// DefaultPackageLogLevels returns a default log level setting so all packages
|
||||||
|
// log at "error", while the `state` and `main` packages log at "info"
|
||||||
func DefaultPackageLogLevels() string {
|
func DefaultPackageLogLevels() string {
|
||||||
return fmt.Sprintf("state:info,*:%s", DefaultLogLevel())
|
return fmt.Sprintf("main:info,state:info,*:%s", DefaultLogLevel())
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user