mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
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:
parent
fd91064016
commit
1e794136c8
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue