add some String() to make codes easier to read and debug

This commit is contained in:
yanyiwu
2015-01-08 15:54:50 +08:00
parent f2b07d6051
commit cacfc85869
8 changed files with 41 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package storage
import (
"fmt"
"github.com/chrislusf/weed-fs/go/operation"
)
@@ -36,3 +37,7 @@ func NewVolumeInfo(m *operation.VolumeInformationMessage) (vi VolumeInfo, err er
vi.Ttl = LoadTTLFromUint32(*m.Ttl)
return vi, nil
}
func (vi VolumeInfo) String() string {
return fmt.Sprintf("Id:%s, Size:%d, ReplicaPlacement:%s, Collection:%s, Version:%v, FileCount:%d, DeleteCount:%d, DeletedByteCount:%d, ReadOnly:%v", vi.Id, vi.Size, vi.ReplicaPlacement, vi.Collection, vi.Version, vi.FileCount, vi.DeleteCount, vi.DeletedByteCount, vi.ReadOnly)
}