treewide: ban global zerolog

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-10-30 09:27:58 -06:00
parent aa7a2d186b
commit 0046975aa5
3 changed files with 6 additions and 7 deletions
+1 -2
View File
@@ -10,7 +10,6 @@ import (
"github.com/gotd/td/tg"
"github.com/gotd/td/tgerr"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"maunium.net/go/mautrix/bridgev2"
"maunium.net/go/mautrix/bridgev2/database"
"maunium.net/go/mautrix/bridgev2/networkid"
@@ -24,6 +23,7 @@ func (t *TelegramClient) getTakeoutID(ctx context.Context) (takeoutID int64, err
if t.stopTakeoutTimer != nil {
t.stopTakeoutTimer.Stop()
}
log := zerolog.Ctx(ctx).With().Str("function", "getTakeoutID").Logger()
if t.userLogin.Metadata.(*UserLoginMetadata).TakeoutID != 0 {
// Resume fetching dialogs using takeout and enqueueing them for
@@ -38,7 +38,6 @@ func (t *TelegramClient) getTakeoutID(ctx context.Context) (takeoutID int64, err
t.stopTakeoutTimer = time.AfterFunc(max(time.Hour, time.Duration(t.main.Bridge.Config.Backfill.Queue.BatchDelay*2)), sync.OnceFunc(func() { t.stopTakeout(ctx) }))
log := zerolog.Ctx(ctx).With().Str("function", "getTakeoutID").Logger()
for {
t.takeoutAccepted.Clear()
+1 -2
View File
@@ -15,7 +15,6 @@ import (
"github.com/gotd/td/telegram/updates"
"github.com/gotd/td/tg"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"go.mau.fi/util/exsync"
"go.mau.fi/zerozap"
"go.uber.org/zap"
@@ -429,7 +428,7 @@ func (t *TelegramClient) onAuthError(err error) {
})
t.userLogin.Metadata.(*UserLoginMetadata).Session.AuthKey = nil
if err := t.userLogin.Save(context.Background()); err != nil {
log.Err(err).Msg("failed to save user login")
t.main.Bridge.Log.Err(err).Msg("failed to save user login")
}
}