mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 22:01:29 +00:00
logAdapter is more readable
This commit is contained in:
parent
c0fae547e9
commit
7693502aaa
@ -187,12 +187,12 @@ func (bl *BeeLogger) setLogger(adapterName string, configs ...string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log, ok := adapters[adapterName]
|
logAdapter, ok := adapters[adapterName]
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("logs: unknown adaptername %q (forgotten Register?)", adapterName)
|
return fmt.Errorf("logs: unknown adaptername %q (forgotten Register?)", adapterName)
|
||||||
}
|
}
|
||||||
|
|
||||||
lg := log()
|
lg := logAdapter()
|
||||||
err := lg.Init(config)
|
err := lg.Init(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, "logs.BeeLogger.SetLogger: "+err.Error())
|
fmt.Fprintln(os.Stderr, "logs.BeeLogger.SetLogger: "+err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user