SetLogLevel

This commit is contained in:
Ethan Buchman 2016-02-05 23:00:03 +00:00
parent 980f02a500
commit 4901b71ade
1 changed files with 15 additions and 7 deletions

22
log.go
View File

@ -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