Skip to content

Commit

Permalink
s/log.CtxInfof/log.CtxDebugf/
Browse files Browse the repository at this point in the history
Switch happy path log to Debug
  • Loading branch information
sluongng committed Apr 23, 2024
1 parent 57061f7 commit 55556ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/remote_asset/fetch_server/fetch_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (p *FetchServer) findBlobInCache(ctx context.Context, instanceName string,
SizeBytes: 1,
}
cacheRN := digest.NewResourceName(blobDigest, instanceName, rspb.CacheType_CAS, checksumFunc)
log.CtxInfof(ctx, "Looking up %s in cache", blobDigest.Hash)
log.CtxDebugf(ctx, "Looking up %s in cache", blobDigest.Hash)

// Lookup metadata to get the correct digest size to be returned to
// the client.
Expand All @@ -257,7 +257,7 @@ func (p *FetchServer) findBlobInCache(ctx context.Context, instanceName string,
return nil
}

log.CtxInfof(ctx, "FetchServer found %s in cache", digest.String(blobDigest))
log.CtxDebugf(ctx, "FetchServer found %s in cache", digest.String(blobDigest))
return blobDigest
}

Expand All @@ -266,7 +266,7 @@ func (p *FetchServer) findBlobInCache(ctx context.Context, instanceName string,
// expectedChecksum (if non-empty), and if there is a mismatch then an error is
// returned.
func mirrorToCache(ctx context.Context, bsClient bspb.ByteStreamClient, remoteInstanceName string, httpClient *http.Client, uri string, storageFunc repb.DigestFunction_Value, checksumFunc repb.DigestFunction_Value, expectedChecksum string) (*repb.Digest, error) {
log.CtxInfof(ctx, "Fetching %s", uri)
log.CtxDebugf(ctx, "Fetching %s", uri)
rsp, err := httpClient.Get(uri)
if err != nil {
return nil, status.UnavailableErrorf("failed to fetch %q: HTTP GET failed: %s", uri, err)
Expand Down Expand Up @@ -326,7 +326,7 @@ func mirrorToCache(ctx context.Context, bsClient bspb.ByteStreamClient, remoteIn
if checksumFunc == storageFunc && expectedChecksum != "" && blobDigest.Hash != expectedChecksum {
return nil, status.InvalidArgumentErrorf("response body checksum for %q was %q but wanted %q", uri, blobDigest.Hash, expectedChecksum)
}
log.CtxInfof(ctx, "Mirrored %s to cache (digest: %s)", uri, digest.String(blobDigest))
log.CtxDebugf(ctx, "Mirrored %s to cache (digest: %s)", uri, digest.String(blobDigest))
return blobDigest, nil
}

Expand Down

0 comments on commit 55556ae

Please sign in to comment.