[feature] Allow config logging thrift response call separately
at15 opened this issue · 2 comments
at15 commented
Now if we have realis.Debug()
enabled entire job response will get print out, it makes log hard to read for both human and machine (a extreme long line)
// retry.go L152
r.logger.DebugPrintf("Aurora Thrift Call ended resp: %v clientErr: %v\n", resp, clientErr)
Some possible solutions
- add another client option
realis.LogResp
to enable/disable logging response regardless of log level - add more logging level, debug, tracing .... (seems to be overkill)
- allow passing context into request, based on context, enable/disable log response on per request level instead of entire client
btw: I think it's a good idea to allow pass in context.Context
as first parameter in all functions, this allow the caller to cancel the execution and pass in additional key value configs ...
ridv commented
I like the context idea, but that would have to be saved for v2 of gorealis since it would change the interface.
Let's go with option one from your list and use a boolean to toggle the response print.