mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 21:05:10 +00:00
Add debug messages
This commit is contained in:
parent
0d125725bc
commit
31055d88a5
@ -2,6 +2,7 @@ package restic
|
||||
|
||||
import (
|
||||
"io"
|
||||
"restic/debug"
|
||||
)
|
||||
|
||||
type backendReaderAt struct {
|
||||
@ -20,6 +21,7 @@ func ReaderAt(be Backend, h Handle) io.ReaderAt {
|
||||
|
||||
// ReadAt reads from the backend handle h at the given position.
|
||||
func ReadAt(be Backend, h Handle, offset int64, p []byte) (n int, err error) {
|
||||
debug.Log("ReadAt(%v) at %v, len %v", h, offset, len(p))
|
||||
rd, err := be.Load(h, len(p), offset)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@ -31,5 +33,7 @@ func ReadAt(be Backend, h Handle, offset int64, p []byte) (n int, err error) {
|
||||
err = e
|
||||
}
|
||||
|
||||
debug.Log("ReadAt(%v) ReadFull returned %v bytes", h, n)
|
||||
|
||||
return n, err
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ func (r *Repository) Close() error {
|
||||
// be large enough to hold the encrypted blob, since it is used as scratch
|
||||
// space.
|
||||
func (r *Repository) LoadBlob(t restic.BlobType, id restic.ID, buf []byte) (int, error) {
|
||||
debug.Log("load blob %v into buf %p", id.Str(), buf)
|
||||
debug.Log("load blob %v into buf (len %v, cap %v)", id.Str(), len(buf), cap(buf))
|
||||
size, err := r.idx.LookupSize(id, t)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
Loading…
Reference in New Issue
Block a user