MM 19654 s3 debugging logs overlap, Wrapped mlog in an io.Writer func (#25788)

* updated go mod and sum files

* Revert "updated go mod and sum files"

This reverts commit 088dd00a84.

* wrapped mlog in and io.Writer func to pass to TraceOn

* fixed var and func receiver names

* removed the underscore in the func receiver.

* passed a pointer of s3Trace to TraceOn

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Matthew Straughn 2024-02-19 21:29:26 -05:00 committed by GitHub
parent fd91064016
commit 1e794136c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,6 +124,14 @@ func newS3FileBackend(settings FileBackendSettings, isCloud bool) (*S3FileBacken
return backend, nil
}
type s3Trace struct {
}
func (*s3Trace) Write(in []byte) (int, error) {
mlog.Debug(string(in))
return len(in), nil
}
// Similar to s3.New() but allows initialization of signature v2 or signature v4 client.
// If signV2 input is false, function always returns signature v4.
//
@ -178,7 +186,7 @@ func (b *S3FileBackend) s3New(isCloud bool) (*s3.Client, error) {
}
if b.trace {
s3Clnt.TraceOn(os.Stdout)
s3Clnt.TraceOn(&s3Trace{})
}
return s3Clnt, nil