diff options
author | 2023-02-17 12:02:29 +0100 | |
---|---|---|
committer | 2023-02-17 12:02:29 +0100 | |
commit | 68e6d08c768b789987a753d42f66caf73ce10ee1 (patch) | |
tree | 1c9eb6da6c326266d653de80684c3aec58922638 /internal/typeutils/astointernal.go | |
parent | [bugfix] Set 'discoverable' properly on API accounts (#1511) (diff) | |
download | gotosocial-68e6d08c768b789987a753d42f66caf73ce10ee1.tar.xz |
[feature] Add a request ID and include it in logs (#1476)
This adds a lightweight form of tracing to GTS. Each incoming request is
assigned a Request ID which we then pass on and log in all our log
lines. Any function that gets called downstream from an HTTP handler
should now emit a requestID=value pair whenever it logs something.
Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r-- | internal/typeutils/astointernal.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go index fff9c807a..2ed1d52d3 100644 --- a/internal/typeutils/astointernal.go +++ b/internal/typeutils/astointernal.go @@ -82,7 +82,7 @@ func (c *converter) ASRepresentationToAccount(ctx context.Context, accountable a // account emojis (used in bio, display name, fields) if emojis, err := ap.ExtractEmojis(accountable); err != nil { - log.Infof("ASRepresentationToAccount: error extracting account emojis: %s", err) + log.Infof(nil, "error extracting account emojis: %s", err) } else { acct.Emojis = emojis } @@ -217,13 +217,13 @@ func (c *converter) extractAttachments(i ap.WithAttachment) []*gtsmodel.MediaAtt attachmentable, ok := t.(ap.Attachmentable) if !ok { - log.Error("ap attachment was not attachmentable") + log.Error(nil, "ap attachment was not attachmentable") continue } attachment, err := ap.ExtractAttachment(attachmentable) if err != nil { - log.Errorf("error extracting attachment: %s", err) + log.Errorf(nil, "error extracting attachment: %s", err) continue } @@ -684,7 +684,7 @@ func (c *converter) ASFlagToReport(ctx context.Context, flaggable ap.Flaggable) return nil, fmt.Errorf("ASFlagToReport: db error getting status with url %s: %w", statusURIString, err) } - log.Warnf("ASFlagToReport: reported status %s could not be found in the db, skipping it", statusURIString) + log.Warnf(nil, "reported status %s could not be found in the db, skipping it", statusURIString) continue } } |