[BinderTransport] Lower some log level from ERROR to INFO (#27988)

We also plan to introduce a new tracer for tracing binder wireformat
logic.
pull/28009/head
Ming-Chuan 3 years ago committed by GitHub
parent 75a54f55e3
commit 43a79cfce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/core/ext/transport/binder/client/binder_connector.cc
  2. 11
      src/core/ext/transport/binder/client/endpoint_binder_pool.cc
  3. 4
      src/core/ext/transport/binder/server/binder_server.cc

@ -62,7 +62,8 @@ class BinderConnector : public grpc_core::SubchannelConnector {
#else
GPR_ASSERT(0);
#endif
gpr_log(GPR_ERROR, "conn_id_ = %s", conn_id_.c_str());
gpr_log(GPR_INFO, "BinderConnector %p conn_id_ = %s", this,
conn_id_.c_str());
args_ = args;
GPR_ASSERT(notify_ == nullptr);
@ -115,7 +116,7 @@ namespace grpc_core {
grpc_core::RefCountedPtr<grpc_core::Subchannel>
BinderClientChannelFactory::CreateSubchannel(
const grpc_resolved_address& address, const grpc_channel_args* args) {
gpr_log(GPR_ERROR, "BinderClientChannelFactory::CreateSubchannel called");
gpr_log(GPR_INFO, "BinderClientChannelFactory creating subchannel %p", this);
grpc_arg default_authority_arg = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>("binder.authority"));

@ -34,11 +34,11 @@ Java_io_grpc_binder_cpp_GrpcBinderConnection_notifyConnected__Ljava_lang_String_
JNIEnv* jni_env, jobject, jstring conn_id_jstring, jobject ibinder) {
jboolean isCopy;
const char* conn_id = jni_env->GetStringUTFChars(conn_id_jstring, &isCopy);
gpr_log(GPR_ERROR, "%s called with conn_id = %s", __func__, conn_id);
gpr_log(GPR_INFO, "%s invoked with conn_id = %s", __func__, conn_id);
GPR_ASSERT(ibinder != nullptr);
grpc_binder::ndk_util::SpAIBinder aibinder =
grpc_binder::FromJavaBinder(jni_env, ibinder);
gpr_log(GPR_ERROR, "aibinder = %p", aibinder.get());
gpr_log(GPR_INFO, "%s got aibinder = %p", __func__, aibinder.get());
auto b = absl::make_unique<grpc_binder::BinderAndroid>(aibinder);
GPR_ASSERT(b != nullptr);
grpc_binder::GetEndpointBinderPool()->AddEndpointBinder(conn_id,
@ -56,7 +56,7 @@ namespace grpc_binder {
void EndpointBinderPool ::GetEndpointBinder(
std::string conn_id,
std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb) {
gpr_log(GPR_ERROR, "GetEndpointBinder %s", conn_id.c_str());
gpr_log(GPR_INFO, "EndpointBinder requested. conn_id = %s", conn_id.c_str());
std::unique_ptr<grpc_binder::Binder> b;
{
grpc_core::MutexLock l(&m_);
@ -66,7 +66,8 @@ void EndpointBinderPool ::GetEndpointBinder(
GPR_ASSERT(b != nullptr);
} else {
if (pending_requests_.count(conn_id) != 0) {
gpr_log(GPR_ERROR, "Duplicate GetEndpointBinder request. conn_id = %s",
gpr_log(GPR_ERROR,
"Duplicate GetEndpointBinder requested. conn_id = %s",
conn_id.c_str());
return;
}
@ -80,7 +81,7 @@ void EndpointBinderPool ::GetEndpointBinder(
void EndpointBinderPool::AddEndpointBinder(
std::string conn_id, std::unique_ptr<grpc_binder::Binder> b) {
gpr_log(GPR_ERROR, "AddEndpointBinder %s", conn_id.c_str());
gpr_log(GPR_INFO, "EndpointBinder added. conn_id = %s", conn_id.c_str());
GPR_ASSERT(b != nullptr);
// cb will be set in the following block if there is a pending callback
std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb = nullptr;

@ -179,7 +179,7 @@ class BinderServerListener : public Server::ListenerInterface {
return absl::InvalidArgumentError("Not a SETUP_TRANSPORT request");
}
gpr_log(GPR_ERROR, "calling uid = %d", uid);
gpr_log(GPR_INFO, "BinderServerListener calling uid = %d", uid);
if (!security_policy_->IsAuthorized(uid)) {
// TODO(mingcl): For now we just ignore this unauthorized
// SETUP_TRANSPORT transaction and ghost the client. Check if we should
@ -195,7 +195,7 @@ class BinderServerListener : public Server::ListenerInterface {
if (!status.ok()) {
return status;
}
gpr_log(GPR_INFO, "version = %d", version);
gpr_log(GPR_INFO, "BinderTransport client protocol version = %d", version);
// TODO(waynetu): Check supported version.
std::unique_ptr<grpc_binder::Binder> client_binder{};
status = parcel->ReadBinder(&client_binder);

Loading…
Cancel
Save