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 088dd00a848c2c31952c29f0a2a28a9fb47fc3f7. * 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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fd91064016
Коммит
1e794136c8
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user