Correct debug log fucntion names

This commit is contained in:
Alexander Neumann 2015-04-29 23:47:50 +02:00
parent ec108fb708
commit 77a819a925
1 changed files with 5 additions and 5 deletions

View File

@ -99,25 +99,25 @@ func (s *Server) Load(t backend.Type, id backend.ID) ([]byte, error) {
// LoadBlob tries to load and decrypt content identified by t and id from a // LoadBlob tries to load and decrypt content identified by t and id from a
// pack from the backend. // pack from the backend.
func (s *Server) LoadBlob(t pack.BlobType, id backend.ID) ([]byte, error) { func (s *Server) LoadBlob(t pack.BlobType, id backend.ID) ([]byte, error) {
debug.Log("Server.LoadPack", "load %v with id %v", t, id.Str()) debug.Log("Server.LoadBlob", "load %v with id %v", t, id.Str())
// lookup pack // lookup pack
packID, tpe, offset, length, err := s.idx.Lookup(id) packID, tpe, offset, length, err := s.idx.Lookup(id)
if err != nil { if err != nil {
debug.Log("Server.LoadPack", "id %v not found in index: %v", id.Str(), err) debug.Log("Server.LoadBlob", "id %v not found in index: %v", id.Str(), err)
return nil, err return nil, err
} }
if tpe != t { if tpe != t {
debug.Log("Server.LoadPack", "wrong type returned for %v: wanted %v, got %v", id.Str(), t, tpe) debug.Log("Server.LoadBlob", "wrong type returned for %v: wanted %v, got %v", id.Str(), t, tpe)
return nil, fmt.Errorf("blob has wrong type %v (wanted: %v)", tpe, t) return nil, fmt.Errorf("blob has wrong type %v (wanted: %v)", tpe, t)
} }
debug.Log("Server.LoadPack", "id %v found in pack %v at offset %v (length %d)", id.Str(), packID.Str(), offset, length) debug.Log("Server.LoadBlob", "id %v found in pack %v at offset %v (length %d)", id.Str(), packID.Str(), offset, length)
// load blob from pack // load blob from pack
rd, err := s.be.GetReader(backend.Data, packID.String(), offset, length) rd, err := s.be.GetReader(backend.Data, packID.String(), offset, length)
if err != nil { if err != nil {
debug.Log("Server.LoadPack", "error loading pack %v for %v: %v", packID.Str(), id.Str(), err) debug.Log("Server.LoadBlob", "error loading pack %v for %v: %v", packID.Str(), id.Str(), err)
return nil, err return nil, err
} }