add a bool in payload struct

This commit is contained in:
yangzhouhan
2015-07-24 11:30:14 -07:00
parent bd20726bd8
commit 6cfd2022af
3 changed files with 29 additions and 6 deletions

12
call.go
View File

@ -164,7 +164,11 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
return toRPCErr(err)
}
if EnableTracing {
c.traceInfo.tr.LazyLog(&fmtStringer{"sent: %v", []interface{}{payload{args}}}, true)
p := &payload{
sent: true,
msg: args,
}
c.traceInfo.tr.LazyLog(p, true)
}
stream, err = sendRequest(ctx, cc.dopts.codec, callHdr, t, args, topts)
if err != nil {
@ -183,7 +187,11 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
continue
}
if EnableTracing {
c.traceInfo.tr.LazyLog(&fmtStringer{"received: %v", []interface{}{payload{reply}}}, true)
p := &payload{
sent: false,
msg: reply,
}
c.traceInfo.tr.LazyLog(p, true)
}
t.CloseStream(stream, lastErr)
if lastErr != nil {