Commit ce223eef authored by Jeromy's avatar Jeromy

some small cleanup of logging

parent 3ed10b13
...@@ -82,7 +82,7 @@ func addDir(n *core.IpfsNode, fpath string, depth int, out io.Writer) (*dag.Node ...@@ -82,7 +82,7 @@ func addDir(n *core.IpfsNode, fpath string, depth int, out io.Writer) (*dag.Node
} }
} }
log.Info("adding dir: %s", fpath) log.Infof("adding dir: %s", fpath)
return tree, addNode(n, tree, fpath, out) return tree, addNode(n, tree, fpath, out)
} }
...@@ -98,10 +98,10 @@ func addFile(n *core.IpfsNode, fpath string, depth int, out io.Writer) (*dag.Nod ...@@ -98,10 +98,10 @@ func addFile(n *core.IpfsNode, fpath string, depth int, out io.Writer) (*dag.Nod
return nil, err return nil, err
} }
log.Info("adding file: %s", fpath) log.Infof("adding file: %s", fpath)
for _, l := range root.Links { for _, l := range root.Links {
log.Info("adding subblock: %s %s", l.Name, l.Hash.B58String()) log.Infof("adding subblock: '%s' %s", l.Name, l.Hash.B58String())
} }
k, err := root.Key() k, err := root.Key()
......
...@@ -18,7 +18,7 @@ type DagReader struct { ...@@ -18,7 +18,7 @@ type DagReader struct {
serv mdag.DAGService serv mdag.DAGService
node *mdag.Node node *mdag.Node
position int position int
buf *bytes.Buffer buf io.Reader
} }
// NewDagReader creates a new reader object that reads the data represented by the given // NewDagReader creates a new reader object that reads the data represented by the given
...@@ -71,8 +71,13 @@ func (dr *DagReader) precalcNextBuf() error { ...@@ -71,8 +71,13 @@ func (dr *DagReader) precalcNextBuf() error {
return ft.ErrInvalidDirLocation return ft.ErrInvalidDirLocation
case ftpb.Data_File: case ftpb.Data_File:
//TODO: this *should* work, needs testing first //TODO: this *should* work, needs testing first
//return NewDagReader(nxt, dr.serv) log.Warning("Running untested code for multilayered indirect FS reads.")
panic("Not yet handling different layers of indirection!") subr, err := NewDagReader(nxt, dr.serv)
if err != nil {
return err
}
dr.buf = subr
return nil
case ftpb.Data_Raw: case ftpb.Data_Raw:
dr.buf = bytes.NewBuffer(pb.GetData()) dr.buf = bytes.NewBuffer(pb.GetData())
return nil return nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment