mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-02 20:58:07 -06:00
[chore] Update more log calls to include context (#1517)
In #1476 we updated log.WithFields() but we forgot about log.WithField(). Also updates a few explicit log.Entry{} creations.
This commit is contained in:
parent
d39280ec33
commit
b4d18887d3
9 changed files with 19 additions and 12 deletions
|
|
@ -39,7 +39,8 @@ func (f *federatingDB) Accept(ctx context.Context, accept vocab.ActivityStreamsA
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
l := log.WithField("accept", i)
|
||||
l := log.WithContext(ctx).
|
||||
WithField("accept", i)
|
||||
l.Debug("entering Accept")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ func (f *federatingDB) Announce(ctx context.Context, announce vocab.ActivityStre
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
l := log.WithField("announce", i)
|
||||
l := log.WithContext(ctx).
|
||||
WithField("announce", i)
|
||||
l.Debug("entering Announce")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ func (f *federatingDB) Reject(ctx context.Context, reject vocab.ActivityStreamsR
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
l := log.WithField("reject", i)
|
||||
l := log.WithContext(ctx).
|
||||
WithField("reject", i)
|
||||
l.Debug("entering Reject")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import (
|
|||
)
|
||||
|
||||
func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo) error {
|
||||
l := log.Entry{}
|
||||
l := log.Entry{}.WithContext(ctx)
|
||||
|
||||
if log.Level() >= level.DEBUG {
|
||||
i, err := marshalItem(undo)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import (
|
|||
//
|
||||
// The library makes this call only after acquiring a lock first.
|
||||
func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error {
|
||||
l := log.Entry{}
|
||||
l := log.Entry{}.WithContext(ctx)
|
||||
|
||||
if log.Level() >= level.DEBUG {
|
||||
i, err := marshalItem(asType)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ func (f *federatingDB) NewID(ctx context.Context, t vocab.Type) (idURL *url.URL,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
l := log.WithField("newID", i)
|
||||
l := log.WithContext(ctx).
|
||||
WithField("newID", i)
|
||||
l.Debug("entering NewID")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue