aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface/completion_queue.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-06-13 15:20:39 +0000
committerGravatar Craig Tiller <ctiller@google.com>2016-06-13 15:20:39 +0000
commita286b040a90d4a17cb4bb5c51e0dbe09de0a713b (patch)
treea3feb7e4be7aef190e9834199faf4c6b427c7aa1 /src/core/lib/surface/completion_queue.c
parentdbaf05e13d1f98db9329f3e04d80d1b90e9ee231 (diff)
small fixes
Diffstat (limited to 'src/core/lib/surface/completion_queue.c')
-rw-r--r--src/core/lib/surface/completion_queue.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c
index ecc127876b..eaad614842 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.c
@@ -50,6 +50,8 @@
#include "src/core/lib/surface/event_string.h"
#include "src/core/lib/surface/surface_trace.h"
+int grpc_trace_operation_failures;
+
typedef struct {
grpc_pollset_worker **worker;
void *tag;
@@ -231,12 +233,15 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
#endif
GPR_TIMER_BEGIN("grpc_cq_end_op", 0);
- if (grpc_api_trace) {
+ if (grpc_api_trace || (grpc_trace_operation_failures && error != GRPC_ERROR_NONE)) {
const char *errmsg = grpc_error_string(error);
GRPC_API_TRACE(
"grpc_cq_end_op(exec_ctx=%p, cc=%p, tag=%p, error=%s, done=%p, "
"done_arg=%p, storage=%p)",
7, (exec_ctx, cc, tag, errmsg, done, done_arg, storage));
+ if (grpc_trace_operation_failures) {
+ gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
+ }
grpc_error_free_string(errmsg);
}