Make grpc_call_log_batch take const char*

pull/12341/head
yang-g 8 years ago
parent 66e6c23372
commit d3cbd72d5f
  1. 2
      src/core/lib/surface/call.h
  2. 2
      src/core/lib/surface/call_log_batch.c
  3. 7
      src/cpp/server/server_cc.cc

@ -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);

@ -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;

@ -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();
}
}

Loading…
Cancel
Save