diff options
Diffstat (limited to 'internal/federation/federatingdb/create.go')
-rw-r--r-- | internal/federation/federatingdb/create.go | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/internal/federation/federatingdb/create.go b/internal/federation/federatingdb/create.go index 625d75603..a6e55f2ad 100644 --- a/internal/federation/federatingdb/create.go +++ b/internal/federation/federatingdb/create.go @@ -24,12 +24,14 @@ import ( "fmt" "strings" - "github.com/sirupsen/logrus" + "codeberg.org/gruf/go-kv" + "codeberg.org/gruf/go-logger/v2/level" "github.com/superseriousbusiness/activity/streams/vocab" "github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/id" + "github.com/superseriousbusiness/gotosocial/internal/log" "github.com/superseriousbusiness/gotosocial/internal/messages" ) @@ -46,18 +48,12 @@ import ( // Under certain conditions and network activities, Create may be called // multiple times for the same ActivityStreams object. func (f *federatingDB) Create(ctx context.Context, asType vocab.Type) error { - l := logrus.WithFields( - logrus.Fields{ - "func": "Create", - }, - ) - - if logrus.GetLevel() >= logrus.DebugLevel { + if log.Level() >= level.DEBUG { i, err := marshalItem(asType) if err != nil { return err } - l = l.WithField("create", i) + l := log.WithField("create", i) l.Debug("entering Create") } @@ -169,11 +165,10 @@ func (f *federatingDB) activityCreate(ctx context.Context, asType vocab.Type, re // createNote handles a Create activity with a Note type. func (f *federatingDB) createNote(ctx context.Context, note vocab.ActivityStreamsNote, receivingAccount *gtsmodel.Account, requestingAccount *gtsmodel.Account) error { - l := logrus.WithFields(logrus.Fields{ - "func": "createNote", - "receivingAccount": receivingAccount.URI, - "requestingAccount": requestingAccount.URI, - }) + l := log.WithFields(kv.Fields{ + {"receivingAccount", receivingAccount.URI}, + {"requestingAccount", requestingAccount.URI}, + }...) // Check if we have a forward. // In other words, was the note posted to our inbox by at least one actor who actually created the note, or are they just forwarding it? |