From 7b32aad13fbfb82ad78dc9396a1b71d652fb0b08 Mon Sep 17 00:00:00 2001 From: Skip R Date: Wed, 26 Nov 2025 18:28:50 -0800 Subject: [PATCH] attachments: remove trace logging This was for debugging in development only. Also, bridges default to the DEBUG level, so this would not be logged at all unless you intentionally modified your logging configuration. --- pkg/connector/attachments.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/connector/attachments.go b/pkg/connector/attachments.go index eada633..ae12af1 100644 --- a/pkg/connector/attachments.go +++ b/pkg/connector/attachments.go @@ -69,7 +69,6 @@ func downloadDiscordAttachment(cli *http.Client, url string, maxSize int64) ([]b } func (d *DiscordConnector) ReuploadMedia(ctx context.Context, intent bridgev2.MatrixAPI, portal *bridgev2.Portal, upload attachment.AttachmentReupload) (*attachment.ReuploadedAttachment, error) { - log := zerolog.Ctx(ctx) // TODO(skip): Do we need to check if we've already downloaded this media before? // TODO(skip): Read a maximum size from the config. data, err := downloadDiscordAttachment(http.DefaultClient, upload.DownloadingURL, 1_024*1_024*50) @@ -84,20 +83,13 @@ func (d *DiscordConnector) ReuploadMedia(ctx context.Context, intent bridgev2.Ma } fileName := path.Base(url.Path) upload.FileName = fileName - log.Trace().Str("detected_file_name", fileName).Msg("Inferred the file name of the media we're reuploading") } if upload.MimeType == "" { mime := http.DetectContentType(data) upload.MimeType = mime - log.Trace().Str("detected_mime_type", mime).Msg("Inferred the mime type of the media we're reuploading") } - log.Trace().Stringer("portal_mxid", portal.MXID). - Int("attachment_size", len(data)). - Str("file_name", upload.FileName). - Str("mime_type", upload.MimeType). - Msg("Uploading downloaded media") mxc, file, err := intent.UploadMedia(ctx, portal.MXID, data, upload.FileName, upload.MimeType) if err != nil { return nil, err