Log all objects more informatively

This commit is contained in:
Nick Craig-Wood 2015-03-09 08:11:38 +00:00
parent 81a933ae38
commit 873db29391

View File

@ -244,8 +244,8 @@ func NewFs(path string) (Fs, error) {
// Outputs log for object
func OutputLog(o interface{}, text string, args ...interface{}) {
description := ""
if x, ok := o.(fmt.Stringer); ok {
description = x.String() + ": "
if o != nil {
description = fmt.Sprintf("%v: ", o)
}
out := fmt.Sprintf(text, args...)
log.Print(description + out)