diff options
author | yang-g <yangg@google.com> | 2017-09-05 13:42:35 -0700 |
---|---|---|
committer | yang-g <yangg@google.com> | 2017-09-05 13:42:35 -0700 |
commit | d3cbd72d5fce9c1b14f5c27ff48e80508d793249 (patch) | |
tree | 5b8ec76dacaad3509c877631f12b45dd8d2f92d7 | |
parent | 66e6c23372559a49e877f20059abed3336d30572 (diff) |
Make grpc_call_log_batch take const char*
-rw-r--r-- | src/core/lib/surface/call.h | 2 | ||||
-rw-r--r-- | src/core/lib/surface/call_log_batch.c | 2 | ||||
-rw-r--r-- | src/cpp/server/server_cc.cc | 7 |
3 files changed, 4 insertions, 7 deletions
diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index b473e15658..d537637cbb 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -89,7 +89,7 @@ grpc_call_error grpc_call_start_batch_and_execute(grpc_exec_ctx *exec_ctx, /* Given the top call_element, get the call object. */ grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element); -void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, +void grpc_call_log_batch(const char *file, int line, gpr_log_severity severity, grpc_call *call, const grpc_op *ops, size_t nops, void *tag); diff --git a/src/core/lib/surface/call_log_batch.c b/src/core/lib/surface/call_log_batch.c index 4443aba58a..4a1c265817 100644 --- a/src/core/lib/surface/call_log_batch.c +++ b/src/core/lib/surface/call_log_batch.c @@ -103,7 +103,7 @@ char *grpc_op_string(const grpc_op *op) { return out; } -void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, +void grpc_call_log_batch(const char *file, int line, gpr_log_severity severity, grpc_call *call, const grpc_op *ops, size_t nops, void *tag) { char *tmp; diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 4532e4309e..6bd3ecda32 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -45,9 +45,6 @@ #include "src/cpp/thread_manager/thread_manager.h" namespace grpc { -namespace { -constexpr char this_file[] = __FILE__; -} // namespace class DefaultGlobalCallbacks final : public Server::GlobalCallbacks { public: @@ -614,8 +611,8 @@ void Server::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) { auto result = grpc_call_start_batch(call->call(), cops, nops, ops, nullptr); if (result != GRPC_CALL_OK) { gpr_log(GPR_ERROR, "Fatal: grpc_call_start_batch returned %d", result); - grpc_call_log_batch(const_cast<char*>(this_file), __LINE__, - GPR_LOG_SEVERITY_ERROR, call->call(), cops, nops, ops); + grpc_call_log_batch(__FILE__, __LINE__, GPR_LOG_SEVERITY_ERROR, + call->call(), cops, nops, ops); abort(); } } |