1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 00:30:54 +00:00

Add global logging override

This commit is contained in:
IamCathal 2020-08-28 18:47:28 +01:00
parent 6684924e99
commit 0189e6329a

View File

@ -213,7 +213,7 @@ func (bl *BeeLogger) setLogger(adapterName string, configs ...string) error {
// Global formatter overrides the default set formatter // Global formatter overrides the default set formatter
// but not adapter specific formatters set with logs.SetLoggerWithOpts() // but not adapter specific formatters set with logs.SetLoggerWithOpts()
if bl.globalFormatter != nil { if bl.globalFormatter != nil {
err = lg.Init(config) err = lg.Init(config, common.SimpleKV{Key: "formatter", Value: bl.globalFormatter})
} else { } else {
err = lg.Init(config) err = lg.Init(config)
} }