1
mirror of https://github.com/rclone/rclone synced 2024-12-22 13:03:02 +01:00

Tidy logging

This commit is contained in:
Nick Craig-Wood 2015-02-27 15:04:18 +00:00
parent a287e3ced7
commit 85f8552c4d
3 changed files with 5 additions and 8 deletions

View File

@ -10,7 +10,6 @@ package drive
import ( import (
"fmt" "fmt"
"io" "io"
"log"
"mime" "mime"
"net/http" "net/http"
"path" "path"
@ -642,7 +641,7 @@ func (f *FsDrive) List() fs.ObjectsChan {
err := f.findRoot(false) err := f.findRoot(false)
if err != nil { if err != nil {
fs.Stats.Error() fs.Stats.Error()
log.Printf("Couldn't find root: %s", err) fs.Log(f, "Couldn't find root: %s", err)
} else { } else {
if f.root == "" && *driveFullList { if f.root == "" && *driveFullList {
err = f.listDirFull(f.rootId, "", out) err = f.listDirFull(f.rootId, "", out)
@ -651,7 +650,7 @@ func (f *FsDrive) List() fs.ObjectsChan {
} }
if err != nil { if err != nil {
fs.Stats.Error() fs.Stats.Error()
log.Printf("List failed: %s", err) fs.Log(f, "List failed: %s", err)
} }
} }
}() }()
@ -666,7 +665,7 @@ func (f *FsDrive) ListDir() fs.DirChan {
err := f.findRoot(false) err := f.findRoot(false)
if err != nil { if err != nil {
fs.Stats.Error() fs.Stats.Error()
log.Printf("Couldn't find root: %s", err) fs.Log(f, "Couldn't find root: %s", err)
} else { } else {
_, err := f.listAll(f.rootId, "", true, false, func(item *drive.File) bool { _, err := f.listAll(f.rootId, "", true, false, func(item *drive.File) bool {
dir := &fs.Dir{ dir := &fs.Dir{
@ -680,7 +679,7 @@ func (f *FsDrive) ListDir() fs.DirChan {
}) })
if err != nil { if err != nil {
fs.Stats.Error() fs.Stats.Error()
log.Printf("ListDir failed: %s", err) fs.Log(f, "ListDir failed: %s", err)
} }
} }
}() }()

View File

@ -363,7 +363,7 @@ func main() {
fmt.Println(fs.Stats) fmt.Println(fs.Stats)
} }
if fs.Config.Verbose { if fs.Config.Verbose {
log.Printf("*** Go routines at exit %d\n", runtime.NumGoroutine()) fs.Debug(nil, "Go routines at exit %d\n", runtime.NumGoroutine())
} }
if fs.Stats.Errored() { if fs.Stats.Errored() {
os.Exit(1) os.Exit(1)

View File

@ -7,7 +7,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"log"
"mime" "mime"
"net/http" "net/http"
"path" "path"
@ -309,7 +308,6 @@ func (f *FsS3) list(directories bool, fn func(string, *s3.Key)) {
if marker == "" { if marker == "" {
marker = objects.Contents[len(objects.Contents)-1].Key marker = objects.Contents[len(objects.Contents)-1].Key
} }
log.Printf("retry with marker = %q", marker)
} }
} }