Set global zerologger

This commit is contained in:
Tulir Asokan 2023-10-03 21:10:04 +03:00
commit 4e423897f7

View file

@ -22,6 +22,7 @@ import (
"github.com/mattn/go-sqlite3"
"github.com/rs/zerolog"
deflog "github.com/rs/zerolog/log"
"go.mau.fi/util/configupgrade"
"go.mau.fi/util/dbutil"
_ "go.mau.fi/util/dbutil/litestream"
@ -505,6 +506,7 @@ func (br *Bridge) init() {
zerolog.TimeFieldFormat = time.RFC3339Nano
zerolog.CallerMarshalFunc = exzerolog.CallerWithFunctionName
zerolog.DefaultContextLogger = &defaultCtxLog
deflog.Logger = br.ZLog.With().Bool("global_log", true).Caller().Logger()
br.Log = maulogadapt.ZeroAsMau(br.ZLog)
br.DoublePuppet = &doublePuppetUtil{br: br, log: br.ZLog.With().Str("component", "double puppet").Logger()}