From 803640ba4b0befb02aa4aca3700344ce10add88f Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 7 Apr 2023 23:22:00 +0200 Subject: [PATCH] backend: remove a few unnecessary debug logs --- internal/backend/mem/mem_backend.go | 2 -- internal/backend/rest/rest.go | 1 - internal/backend/s3/s3.go | 3 --- internal/backend/swift/swift.go | 5 ----- 4 files changed, 11 deletions(-) diff --git a/internal/backend/mem/mem_backend.go b/internal/backend/mem/mem_backend.go index 4db4c9821..618ef5752 100644 --- a/internal/backend/mem/mem_backend.go +++ b/internal/backend/mem/mem_backend.go @@ -144,8 +144,6 @@ func (be *MemoryBackend) Remove(ctx context.Context, h restic.Handle) error { be.m.Lock() defer be.m.Unlock() - debug.Log("Remove %v", h) - h.ContainedBlobType = restic.InvalidBlob if _, ok := be.data[h]; !ok { return errNotFound diff --git a/internal/backend/rest/rest.go b/internal/backend/rest/rest.go index a88e26daa..f9030d076 100644 --- a/internal/backend/rest/rest.go +++ b/internal/backend/rest/rest.go @@ -207,7 +207,6 @@ func (b *Backend) openReader(ctx context.Context, h restic.Handle, length int, o } req.Header.Set("Range", byteRange) req.Header.Set("Accept", ContentTypeV2) - debug.Log("Load(%v) send range %v", h, byteRange) resp, err := b.client.Do(req) diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index 79c6453b9..591ad2185 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -271,7 +271,6 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe // only use multipart uploads for very large files opts.PartSize = 200 * 1024 * 1024 - debug.Log("PutObject(%v, %v, %v)", be.cfg.Bucket, objName, rd.Length()) info, err := be.client.PutObject(ctx, be.cfg.Bucket, objName, io.NopCloser(rd), int64(rd.Length()), opts) // sanity check @@ -297,10 +296,8 @@ func (be *Backend) openReader(ctx context.Context, h restic.Handle, length int, var err error if length > 0 { - debug.Log("range: %v-%v", offset, offset+int64(length)-1) err = opts.SetRange(offset, offset+int64(length)-1) } else if offset > 0 { - debug.Log("range: %v-", offset) err = opts.SetRange(offset, 0) } diff --git a/internal/backend/swift/swift.go b/internal/backend/swift/swift.go index dbf4ba0d1..fcdbe6634 100644 --- a/internal/backend/swift/swift.go +++ b/internal/backend/swift/swift.go @@ -146,10 +146,6 @@ func (be *beSwift) openReader(ctx context.Context, h restic.Handle, length int, headers["Range"] = fmt.Sprintf("bytes=%d-%d", offset, offset+int64(length)-1) } - if _, ok := headers["Range"]; ok { - debug.Log("Load(%v) send range %v", h, headers["Range"]) - } - obj, _, err := be.conn.ObjectOpen(ctx, be.container, objName, false, headers) if err != nil { return nil, errors.Wrap(err, "conn.ObjectOpen") @@ -163,7 +159,6 @@ func (be *beSwift) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe objName := be.Filename(h) encoding := "binary/octet-stream" - debug.Log("PutObject(%v, %v, %v)", be.container, objName, encoding) hdr := swift.Headers{"Content-Length": strconv.FormatInt(rd.Length(), 10)} _, err := be.conn.ObjectPut(ctx, be.container, objName, rd, true, hex.EncodeToString(rd.Hash()),