SetLogLevel
This commit is contained in:
parent
980f02a500
commit
4901b71ade
22
log.go
22
log.go
|
@ -15,14 +15,11 @@ func init() {
|
|||
Reset()
|
||||
}
|
||||
|
||||
// You might want to call this after resetting tendermint/go-config.
|
||||
func Reset() {
|
||||
|
||||
var logLevel string = "debug"
|
||||
if config != nil {
|
||||
logLevel = config.GetString("log_level")
|
||||
}
|
||||
func SetLogLevel(logLevel string) {
|
||||
resetWithLogLevel(logLevel)
|
||||
}
|
||||
|
||||
func resetWithLogLevel(logLevel string) {
|
||||
// main handler
|
||||
//handlers := []log15.Handler{}
|
||||
mainHandler = log15.LvlFilterHandler(
|
||||
|
@ -42,6 +39,17 @@ func Reset() {
|
|||
log15.Root().SetHandler(mainHandler)
|
||||
}
|
||||
|
||||
// You might want to call this after resetting tendermint/go-config.
|
||||
func Reset() {
|
||||
|
||||
var logLevel string = "debug"
|
||||
if config != nil {
|
||||
logLevel = config.GetString("log_level")
|
||||
}
|
||||
|
||||
resetWithLogLevel(logLevel)
|
||||
}
|
||||
|
||||
// See go-wire/log for an example of usage.
|
||||
func MainHandler() log15.Handler {
|
||||
return mainHandler
|
||||
|
|
Loading…
Reference in New Issue