Browse Source

SetLogLevel

pull/1842/head
Ethan Buchman 9 years ago
parent
commit
4901b71ade
1 changed files with 15 additions and 7 deletions
  1. +15
    -7
      log.go

+ 15
- 7
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


Loading…
Cancel
Save