diff options
| author | chrislu <chris.lu@gmail.com> | 2025-05-22 09:54:31 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2025-05-22 09:54:31 -0700 |
| commit | 0d62be44846354c3c37b857028297edd4b8df17b (patch) | |
| tree | c89320a7d58351030f1b740c7267f56bf0206429 /weed/operation/upload_content.go | |
| parent | d8c574a5ef1a811f9a0d447097d9edfcc0c1d84c (diff) | |
| download | seaweedfs-origin/changing-to-zap.tar.xz seaweedfs-origin/changing-to-zap.zip | |
Diffstat (limited to 'weed/operation/upload_content.go')
| -rw-r--r-- | weed/operation/upload_content.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 0cf6bf7cf..e583d97a7 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -16,7 +16,7 @@ import ( "sync" "time" - "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/util/log" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/security" "github.com/seaweedfs/seaweedfs/weed/stats" @@ -114,7 +114,7 @@ func (uploader *Uploader) UploadWithRetry(filerClient filer_pb.FilerClient, assi if grpcAssignErr := filerClient.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { resp, assignErr := client.AssignVolume(context.Background(), assignRequest) if assignErr != nil { - glog.V(0).Infof("assign volume failure %v: %v", assignRequest, assignErr) + log.V(3).Infof("assign volume failure %v: %v", assignRequest, assignErr) return assignErr } if resp.Error != "" { @@ -139,7 +139,7 @@ func (uploader *Uploader) UploadWithRetry(filerClient filer_pb.FilerClient, assi } if uploadOption.RetryForever { util.RetryUntil("uploadWithRetryForever", doUploadFunc, func(err error) (shouldContinue bool) { - glog.V(0).Infof("upload content: %v", err) + log.V(3).Infof("upload content: %v", err) return true }) } else { @@ -187,7 +187,7 @@ func (uploader *Uploader) retriedUploadData(data []byte, option *UploadOption) ( uploadResult.RetryCount = i return } - glog.Warningf("uploading %d to %s: %v", i, option.UploadUrl, err) + log.Warningf("uploading %d to %s: %v", i, option.UploadUrl, err) } return } @@ -329,16 +329,16 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er file_writer, cp_err := body_writer.CreatePart(h) if cp_err != nil { - glog.V(0).Infoln("error creating form file", cp_err.Error()) + log.V(3).Infoln("error creating form file", cp_err.Error()) return nil, cp_err } if err := fillBufferFunction(file_writer); err != nil { - glog.V(0).Infoln("error copying data", err) + log.V(3).Infoln("error copying data", err) return nil, err } content_type := body_writer.FormDataContentType() if err := body_writer.Close(); err != nil { - glog.V(0).Infoln("error closing body", err) + log.V(3).Infoln("error closing body", err) return nil, err } if option.BytesBuffer == nil { @@ -348,7 +348,7 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er } req, postErr := http.NewRequest(http.MethodPost, option.UploadUrl, reqReader) if postErr != nil { - glog.V(1).Infof("create upload request %s: %v", option.UploadUrl, postErr) + log.V(2).Infof("create upload request %s: %v", option.UploadUrl, postErr) return nil, fmt.Errorf("create upload request %s: %v", option.UploadUrl, postErr) } req.Header.Set("Content-Type", content_type) @@ -364,7 +364,7 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er if post_err != nil { if strings.Contains(post_err.Error(), "connection reset by peer") || strings.Contains(post_err.Error(), "use of closed network connection") { - glog.V(1).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr) + log.V(2).Infof("repeat error upload request %s: %v", option.UploadUrl, postErr) stats.FilerHandlerCounter.WithLabelValues(stats.RepeatErrorUploadContent).Inc() resp, post_err = uploader.httpClient.Do(req) defer util_http.CloseResponse(resp) @@ -389,7 +389,7 @@ func (uploader *Uploader) upload_content(fillBufferFunction func(w io.Writer) er unmarshal_err := json.Unmarshal(resp_body, &ret) if unmarshal_err != nil { - glog.Errorf("unmarshal %s: %v", option.UploadUrl, string(resp_body)) + log.Errorf("unmarshal %s: %v", option.UploadUrl, string(resp_body)) return nil, fmt.Errorf("unmarshal %v: %v", option.UploadUrl, unmarshal_err) } if ret.Error != "" { |
