1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-15 06:51:00 +00:00

beego: fix log output when SetLogger has error

This commit is contained in:
slene
2014-04-04 07:33:13 +08:00
committed by astaxie
parent 6497f29ed7
commit 9421a21037
2 changed files with 6 additions and 2 deletions

View File

@ -43,6 +43,9 @@ func NewConsole() LoggerInterface {
// init console logger.
// jsonconfig like '{"level":LevelTrace}'.
func (c *ConsoleWriter) Init(jsonconfig string) error {
if len(jsonconfig) == 0 {
return nil
}
err := json.Unmarshal([]byte(jsonconfig), c)
if err != nil {
return err