Reset log after config changes.

This commit is contained in:
Jae Kwon
2015-03-30 21:53:22 -07:00
committed by Ethan Buchman
parent 60f166e823
commit 39d5ff9ccb
4 changed files with 18 additions and 12 deletions

View File

@ -11,19 +11,12 @@ import (
var rootHandler log15.Handler
func getLevel(lvlString string) log15.Lvl {
lvl, err := log15.LvlFromString(lvlString)
if err != nil {
Exit(Fmt("Invalid log level %v: %v", lvlString, err))
}
return lvl
}
func init() {
InitLog()
Reset()
}
func InitLog() {
// You might want to call this after resetting tendermint/config.
func Reset() {
handlers := []log15.Handler{}
// By default, there's a stdout terminal format handler.
@ -62,3 +55,11 @@ func RootHandler() log15.Handler {
func New(ctx ...interface{}) log15.Logger {
return log15.Root().New(ctx...)
}
func getLevel(lvlString string) log15.Lvl {
lvl, err := log15.LvlFromString(lvlString)
if err != nil {
Exit(Fmt("Invalid log level %v: %v", lvlString, err))
}
return lvl
}