Skip to content

Commit

Permalink
fix: adjust dfget console log
Browse files Browse the repository at this point in the history
Signed-off-by: zuozheng.hzz <zuozheng.hzz@alibaba-inc.com>
  • Loading branch information
garfield009 committed Aug 19, 2021
1 parent f803671 commit c2288bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions client/dfget/dfget.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func download(ctx context.Context, client daemonclient.DaemonClient, cfg *config
_ = pb.Close()
}

wLog.Infof("download from daemon success, length: %d cost: %d", result.CompletedLength, time.Now().Sub(start).Milliseconds())
fmt.Printf("finish total length %dbytes\n", result.CompletedLength)
wLog.Infof("download from daemon success, length: %d bytes cost: %d ms", result.CompletedLength, time.Now().Sub(start).Milliseconds())
fmt.Printf("finish total length %d bytes\n", result.CompletedLength)

break
}
Expand Down Expand Up @@ -174,8 +174,8 @@ func downloadFromSource(ctx context.Context, cfg *config.DfgetConfig, hdr map[st
return err
}

wLog.Infof("download from source success, length: %d cost: %d", written, time.Now().Sub(start).Milliseconds())
fmt.Printf("finish total length %dbytes\n", written)
wLog.Infof("download from source success, length: %d bytes cost: %d ms", written, time.Now().Sub(start).Milliseconds())
fmt.Printf("finish total length %d bytes\n", written)

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/dfget/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ var rootCmd = &cobra.Command{
var errInfo string
err := runDfget()
if err != nil {
errInfo = fmt.Sprintf("error: %v", err)
errInfo = fmt.Sprintf(", error: %v", err)
}

msg := fmt.Sprintf("download success: %t cost: %dms %s", err == nil, time.Now().Sub(start).Milliseconds(), errInfo)
msg := fmt.Sprintf("download success: %t cost: %d ms%s", err == nil, time.Now().Sub(start).Milliseconds(), errInfo)
logger.With("url", dfgetConfig.URL).Info(msg)
fmt.Println(msg)

Expand Down

0 comments on commit c2288bf

Please sign in to comment.