clean up log fmt usage. Move to log for important data changes,

warnings.
This commit is contained in:
Chris Lu
2013-07-13 19:44:24 -07:00
parent ae3245f1dc
commit ac15868694
10 changed files with 40 additions and 41 deletions

View File

@@ -2,7 +2,7 @@ package topology
import (
"code.google.com/p/weed-fs/go/storage"
"fmt"
"log"
"math/rand"
"time"
)
@@ -28,10 +28,10 @@ func (t *Topology) StartRefreshWritableVolumes(garbageThreshold string) {
t.SetVolumeCapacityFull(v)
case dn := <-t.chanRecoveredDataNodes:
t.RegisterRecoveredDataNode(dn)
fmt.Println("DataNode", dn, "is back alive!")
log.Println("DataNode", dn, "is back alive!")
case dn := <-t.chanDeadDataNodes:
t.UnRegisterDataNode(dn)
fmt.Println("DataNode", dn, "is dead!")
log.Println("DataNode", dn, "is dead!")
}
}
}()
@@ -48,7 +48,7 @@ func (t *Topology) SetVolumeCapacityFull(volumeInfo storage.VolumeInfo) bool {
}
func (t *Topology) UnRegisterDataNode(dn *DataNode) {
for _, v := range dn.volumes {
fmt.Println("Removing Volume", v.Id, "from the dead volume server", dn)
log.Println("Removing Volume", v.Id, "from the dead volume server", dn)
vl := t.GetVolumeLayout(v.RepType)
vl.SetVolumeUnavailable(dn, v.Id)
}