summaryrefslogtreecommitdiff
path: root/internal/federation/federatingprotocol.go
diff options
context:
space:
mode:
authorLibravatar R. Aidan Campbell <raidancampbell@users.noreply.github.com>2021-10-11 05:37:33 -0700
committerLibravatar GitHub <noreply@github.com>2021-10-11 14:37:33 +0200
commit083099a9575f8b2fac22c1d4a51a9dd0e2201243 (patch)
treed1787aa544679c433f797d2313ce532250fe574f /internal/federation/federatingprotocol.go
parentHandle forwarded messages (#273) (diff)
downloadgotosocial-083099a9575f8b2fac22c1d4a51a9dd0e2201243.tar.xz
reference global logrus (#274)
* reference logrus' global logger instead of passing and storing a logger reference everywhere * always directly use global logrus logger instead of referencing an instance * test suites should also directly use the global logrus logger * rename gin logging function to clarify that it's middleware * correct comments which erroneously referenced removed logger parameter * setting log level for tests now uses logrus' exported type instead of the string value, to guarantee error isn't possible
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r--internal/federation/federatingprotocol.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go
index afa763d98..ea9084609 100644
--- a/internal/federation/federatingprotocol.go
+++ b/internal/federation/federatingprotocol.go
@@ -61,7 +61,7 @@ import (
// write a response to the ResponseWriter as is expected that the caller
// to PostInbox will do so when handling the error.
func (f *federator) PostInboxRequestBodyHook(ctx context.Context, r *http.Request, activity pub.Activity) (context.Context, error) {
- l := f.log.WithFields(logrus.Fields{
+ l := logrus.WithFields(logrus.Fields{
"func": "PostInboxRequestBodyHook",
"useragent": r.UserAgent(),
"url": r.URL.String(),
@@ -93,7 +93,7 @@ func (f *federator) PostInboxRequestBodyHook(ctx context.Context, r *http.Reques
// authenticated must be true and error nil. The request will continue
// to be processed.
func (f *federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
- l := f.log.WithFields(logrus.Fields{
+ l := logrus.WithFields(logrus.Fields{
"func": "AuthenticatePostInbox",
"useragent": r.UserAgent(),
"url": r.URL.String(),
@@ -177,7 +177,7 @@ func (f *federator) AuthenticatePostInbox(ctx context.Context, w http.ResponseWr
// blocked must be false and error nil. The request will continue
// to be processed.
func (f *federator) Blocked(ctx context.Context, actorIRIs []*url.URL) (bool, error) {
- l := f.log.WithFields(logrus.Fields{
+ l := logrus.WithFields(logrus.Fields{
"func": "Blocked",
})
l.Debugf("entering BLOCKED function with IRI list: %+v", actorIRIs)
@@ -185,7 +185,7 @@ func (f *federator) Blocked(ctx context.Context, actorIRIs []*url.URL) (bool, er
receivingAccountI := ctx.Value(util.APReceivingAccount)
receivingAccount, ok := receivingAccountI.(*gtsmodel.Account)
if !ok {
- f.log.Errorf("receiving account not set on request context")
+ l.Errorf("receiving account not set on request context")
return false, errors.New("receiving account not set on request context, so couldn't determine blocks")
}
@@ -276,7 +276,7 @@ func (f *federator) FederatingCallbacks(ctx context.Context) (wrapped pub.Federa
// type and extension, so the unhandled ones are passed to
// DefaultCallback.
func (f *federator) DefaultCallback(ctx context.Context, activity pub.Activity) error {
- l := f.log.WithFields(logrus.Fields{
+ l := logrus.WithFields(logrus.Fields{
"func": "DefaultCallback",
"aptype": activity.GetTypeName(),
})