diff --git a/src/core/tsi/alts/frame_protector/frame_handler.cc b/src/core/tsi/alts/frame_protector/frame_handler.cc index 0c22491fd3a..be0d227759b 100644 --- a/src/core/tsi/alts/frame_protector/frame_handler.cc +++ b/src/core/tsi/alts/frame_protector/frame_handler.cc @@ -24,8 +24,9 @@ #include +#include "absl/log/log.h" + #include -#include #include #include "src/core/lib/gprpp/crash.h" @@ -57,7 +58,7 @@ bool alts_reset_frame_writer(alts_frame_writer* writer, if (buffer == nullptr) return false; size_t max_input_size = SIZE_MAX - kFrameLengthFieldSize; if (length > max_input_size) { - gpr_log(GPR_ERROR, "length must be at most %zu", max_input_size); + LOG(ERROR) << "length must be at most " << max_input_size; return false; } writer->input_buffer = buffer; @@ -181,17 +182,17 @@ bool alts_read_frame_bytes(alts_frame_reader* reader, size_t frame_length = load_32_le(reader->header_buffer); if (frame_length < kFrameMessageTypeFieldSize || frame_length > kFrameMaxSize) { - gpr_log(GPR_ERROR, - "Bad frame length (should be at least %zu, and at most %zu)", - kFrameMessageTypeFieldSize, kFrameMaxSize); + LOG(ERROR) << "Bad frame length (should be at least " + << kFrameMessageTypeFieldSize << ", and at most " + << kFrameMaxSize << ")"; *bytes_size = 0; return false; } size_t message_type = load_32_le(reader->header_buffer + kFrameLengthFieldSize); if (message_type != kFrameMessageType) { - gpr_log(GPR_ERROR, "Unsupported message type %zu (should be %zu)", - message_type, kFrameMessageType); + LOG(ERROR) << "Unsupported message type " << message_type + << " (should be " << kFrameMessageType << ")"; *bytes_size = 0; return false; } diff --git a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc index 91afee2e5f5..871b3515dc2 100644 --- a/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +++ b/src/core/tsi/alts/handshaker/alts_handshaker_client.cc @@ -27,7 +27,6 @@ #include #include -#include #include #include "src/core/lib/gprpp/crash.h" @@ -235,8 +234,8 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c, return; } if (recv_buffer == nullptr) { - gpr_log(GPR_ERROR, - "recv_buffer is nullptr in alts_tsi_handshaker_handle_response()"); + LOG(ERROR) + << "recv_buffer is nullptr in alts_tsi_handshaker_handle_response()"; handle_response_done( client, TSI_INTERNAL_ERROR, "recv_buffer is nullptr in alts_tsi_handshaker_handle_response()", @@ -471,11 +470,10 @@ static void on_status_received(void* arg, grpc_error_handle error) { // status from the final ALTS message with the status here. char* status_details = grpc_slice_to_c_string(client->handshake_status_details); - gpr_log(GPR_INFO, - "alts_grpc_handshaker_client:%p on_status_received " - "status:%d details:|%s| error:|%s|", - client, client->handshake_status_code, status_details, - grpc_core::StatusToString(error).c_str()); + LOG(INFO) << "alts_grpc_handshaker_client:" << client + << " on_status_received status:" << client->handshake_status_code + << " details:|" << status_details << "| error:|" + << grpc_core::StatusToString(error) << "|"; gpr_free(status_details); } maybe_complete_tsi_next(client, true /* receive_status_finished */, diff --git a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc index fa22ca884b7..ef91dec2087 100644 --- a/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +++ b/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -186,10 +185,9 @@ static tsi_result handshaker_result_create_zero_copy_grpc_protector( max_frame_size = std::max(max_frame_size, kTsiAltsMinFrameSize); } max_output_protected_frame_size = &max_frame_size; - gpr_log(GPR_DEBUG, - "After Frame Size Negotiation, maximum frame size used by frame " - "protector equals %zu", - *max_output_protected_frame_size); + VLOG(2) << "After Frame Size Negotiation, maximum frame size used by frame " + "protector equals " + << *max_output_protected_frame_size; tsi_result ok = alts_zero_copy_grpc_protector_create( grpc_core::GsecKeyFactory({reinterpret_cast(result->key_data), kAltsAes128GcmRekeyKeyLength}, @@ -392,9 +390,8 @@ static void on_handshaker_service_resp_recv(void* arg, } bool success = true; if (!error.ok()) { - gpr_log(GPR_INFO, - "ALTS handshaker on_handshaker_service_resp_recv error: %s", - grpc_core::StatusToString(error).c_str()); + LOG(INFO) << "ALTS handshaker on_handshaker_service_resp_recv error: " + << grpc_core::StatusToString(error); success = false; } alts_handshaker_client_handle_response(client, success); diff --git a/src/core/tsi/alts/handshaker/transport_security_common_api.cc b/src/core/tsi/alts/handshaker/transport_security_common_api.cc index 79fafc8f0af..9506eaa3b6a 100644 --- a/src/core/tsi/alts/handshaker/transport_security_common_api.cc +++ b/src/core/tsi/alts/handshaker/transport_security_common_api.cc @@ -27,9 +27,8 @@ bool grpc_gcp_rpc_protocol_versions_set_max( grpc_gcp_rpc_protocol_versions* versions, uint32_t max_major, uint32_t max_minor) { if (versions == nullptr) { - gpr_log(GPR_ERROR, - "versions is nullptr in " - "grpc_gcp_rpc_protocol_versions_set_max()."); + LOG(ERROR) + << "versions is nullptr in grpc_gcp_rpc_protocol_versions_set_max()."; return false; } versions->max_rpc_version.major = max_major; @@ -41,9 +40,8 @@ bool grpc_gcp_rpc_protocol_versions_set_min( grpc_gcp_rpc_protocol_versions* versions, uint32_t min_major, uint32_t min_minor) { if (versions == nullptr) { - gpr_log(GPR_ERROR, - "versions is nullptr in " - "grpc_gcp_rpc_protocol_versions_set_min()."); + LOG(ERROR) + << "versions is nullptr in grpc_gcp_rpc_protocol_versions_set_min()."; return false; } versions->min_rpc_version.major = min_major; @@ -54,9 +52,8 @@ bool grpc_gcp_rpc_protocol_versions_set_min( bool grpc_gcp_rpc_protocol_versions_encode( const grpc_gcp_rpc_protocol_versions* versions, grpc_slice* slice) { if (versions == nullptr || slice == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_rpc_protocol_versions_encode()."); + LOG(ERROR) << "Invalid nullptr arguments to " + "grpc_gcp_rpc_protocol_versions_encode()."; return false; } upb::Arena arena; @@ -72,9 +69,8 @@ bool grpc_gcp_rpc_protocol_versions_encode( const grpc_gcp_RpcProtocolVersions* versions, upb_Arena* arena, grpc_slice* slice) { if (versions == nullptr || arena == nullptr || slice == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to " - "grpc_gcp_rpc_protocol_versions_encode()."); + LOG(ERROR) << "Invalid nullptr arguments to " + "grpc_gcp_rpc_protocol_versions_encode()."; return false; } size_t buf_length; @@ -90,9 +86,8 @@ bool grpc_gcp_rpc_protocol_versions_encode( bool grpc_gcp_rpc_protocol_versions_decode( const grpc_slice& slice, grpc_gcp_rpc_protocol_versions* versions) { if (versions == nullptr) { - gpr_log(GPR_ERROR, - "version is nullptr in " - "grpc_gcp_rpc_protocol_versions_decode()."); + LOG(ERROR) + << "version is nullptr in grpc_gcp_rpc_protocol_versions_decode()."; return false; } upb::Arena arena; @@ -157,9 +152,7 @@ bool grpc_gcp_rpc_protocol_versions_copy( grpc_gcp_rpc_protocol_versions* dst) { if ((src == nullptr && dst != nullptr) || (src != nullptr && dst == nullptr)) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_rpc_protocol_versions_copy()."); + LOG(ERROR) << "Invalid arguments to grpc_gcp_rpc_protocol_versions_copy()."; return false; } if (src == nullptr) { @@ -197,9 +190,8 @@ bool grpc_gcp_rpc_protocol_versions_check( const grpc_gcp_rpc_protocol_versions* peer_versions, grpc_gcp_rpc_protocol_versions_version* highest_common_version) { if (local_versions == nullptr || peer_versions == nullptr) { - gpr_log(GPR_ERROR, - "Invalid arguments to " - "grpc_gcp_rpc_protocol_versions_check()."); + LOG(ERROR) + << "Invalid arguments to grpc_gcp_rpc_protocol_versions_check()."; return false; } // max_common_version is MIN(local.max, peer.max) diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc index 8d9a98dbc45..c520f942683 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc @@ -24,7 +24,6 @@ #include "absl/log/log.h" #include -#include #include #include "src/core/lib/gprpp/crash.h" @@ -85,8 +84,8 @@ static tsi_result alts_grpc_integrity_only_protect( // Input sanity check. if (rp == nullptr || unprotected_slices == nullptr || protected_slices == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol protect."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol protect."; return TSI_INVALID_ARGUMENT; } alts_grpc_integrity_only_record_protocol* integrity_only_record_protocol = @@ -127,9 +126,8 @@ static tsi_result alts_grpc_integrity_only_unprotect( // Input sanity check. if (rp == nullptr || protected_slices == nullptr || unprotected_slices == nullptr) { - gpr_log( - GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol unprotect."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol unprotect."; return TSI_INVALID_ARGUMENT; } if (protected_slices->length < rp->header_length + rp->tag_length) { @@ -202,8 +200,8 @@ tsi_result alts_grpc_integrity_only_record_protocol_create( gsec_aead_crypter* crypter, size_t overflow_size, bool is_client, bool is_protect, bool enable_extra_copy, alts_grpc_record_protocol** rp) { if (crypter == nullptr || rp == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol create."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol create."; return TSI_INVALID_ARGUMENT; } alts_grpc_integrity_only_record_protocol* impl = diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc index a9aac4948a9..c919522e4a1 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc @@ -21,7 +21,6 @@ #include "absl/log/log.h" #include -#include #include #include "src/core/lib/gprpp/crash.h" @@ -41,8 +40,8 @@ static tsi_result alts_grpc_privacy_integrity_protect( // Input sanity check. if (rp == nullptr || unprotected_slices == nullptr || protected_slices == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol protect."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol protect."; return TSI_INVALID_ARGUMENT; } // Allocates memory for output frame. In privacy-integrity protect, the @@ -78,9 +77,8 @@ static tsi_result alts_grpc_privacy_integrity_unprotect( // Input sanity check. if (rp == nullptr || protected_slices == nullptr || unprotected_slices == nullptr) { - gpr_log( - GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol unprotect."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol unprotect."; return TSI_INVALID_ARGUMENT; } // Allocates memory for output frame. In privacy-integrity unprotect, the @@ -127,8 +125,8 @@ tsi_result alts_grpc_privacy_integrity_record_protocol_create( gsec_aead_crypter* crypter, size_t overflow_size, bool is_client, bool is_protect, alts_grpc_record_protocol** rp) { if (crypter == nullptr || rp == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol create."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol create."; return TSI_INVALID_ARGUMENT; } auto* impl = static_cast( diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc index da2eaf4bfad..d8d7106bb71 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc @@ -21,9 +21,9 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" #include -#include #include #include "src/core/lib/gprpp/crash.h" @@ -96,8 +96,8 @@ tsi_result alts_grpc_record_protocol_init(alts_grpc_record_protocol* rp, bool is_integrity_only, bool is_protect) { if (rp == nullptr || crypter == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to alts_grpc_record_protocol init."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_grpc_record_protocol init."; return TSI_INVALID_ARGUMENT; } // Creates alts_iovec_record_protocol. @@ -106,8 +106,8 @@ tsi_result alts_grpc_record_protocol_init(alts_grpc_record_protocol* rp, crypter, overflow_size, is_client, is_integrity_only, is_protect, &rp->iovec_rp, &error_details); if (status != GRPC_STATUS_OK) { - gpr_log(GPR_ERROR, "Failed to create alts_iovec_record_protocol, %s.", - error_details); + LOG(ERROR) << "Failed to create alts_iovec_record_protocol, " + << error_details; gpr_free(error_details); return TSI_INTERNAL_ERROR; } diff --git a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc index 3d29dc6de9e..fce90b47f48 100644 --- a/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc +++ b/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc @@ -27,7 +27,6 @@ #include "absl/log/log.h" #include -#include #include #include "src/core/tsi/alts/crypt/gsec.h" @@ -180,8 +179,7 @@ static tsi_result alts_zero_copy_grpc_protector_unprotect( grpc_slice_buffer* unprotected_slices, int* min_progress_size) { if (self == nullptr || unprotected_slices == nullptr || protected_slices == nullptr) { - gpr_log(GPR_ERROR, - "Invalid nullptr arguments to zero-copy grpc unprotect."); + LOG(ERROR) << "Invalid nullptr arguments to zero-copy grpc unprotect."; return TSI_INVALID_ARGUMENT; } alts_zero_copy_grpc_protector* protector = @@ -266,9 +264,8 @@ tsi_result alts_zero_copy_grpc_protector_create( size_t* max_protected_frame_size, tsi_zero_copy_grpc_protector** protector) { if (protector == nullptr) { - gpr_log( - GPR_ERROR, - "Invalid nullptr arguments to alts_zero_copy_grpc_protector create."); + LOG(ERROR) + << "Invalid nullptr arguments to alts_zero_copy_grpc_protector create."; return TSI_INVALID_ARGUMENT; } // Creates alts_zero_copy_protector. diff --git a/src/core/tsi/fake_transport_security.cc b/src/core/tsi/fake_transport_security.cc index 6e58d5ea415..d32faac9e27 100644 --- a/src/core/tsi/fake_transport_security.cc +++ b/src/core/tsi/fake_transport_security.cc @@ -25,7 +25,6 @@ #include "absl/log/log.h" #include -#include #include #include "src/core/lib/gprpp/crash.h" @@ -641,9 +640,9 @@ static tsi_result fake_handshaker_get_bytes_to_send_to_peer( next_message_to_send = TSI_FAKE_HANDSHAKE_MESSAGE_MAX; } if (GRPC_TRACE_FLAG_ENABLED(tsi)) { - gpr_log(GPR_INFO, "%s prepared %s.", - impl->is_client ? "Client" : "Server", - tsi_fake_handshake_message_to_string(impl->next_message_to_send)); + LOG(INFO) << (impl->is_client ? "Client" : "Server") << " prepared " + << tsi_fake_handshake_message_to_string( + impl->next_message_to_send); } impl->next_message_to_send = next_message_to_send; } @@ -688,9 +687,10 @@ static tsi_result fake_handshaker_process_bytes_from_peer( return result; } if (received_msg != expected_msg) { - gpr_log(GPR_ERROR, "Invalid received message (%s instead of %s)", - tsi_fake_handshake_message_to_string(received_msg), - tsi_fake_handshake_message_to_string(expected_msg)); + LOG(ERROR) << "Invalid received message (" + << tsi_fake_handshake_message_to_string(received_msg) + << " instead of " + << tsi_fake_handshake_message_to_string(expected_msg) << ")"; } GRPC_TRACE_LOG(tsi, INFO) << (impl->is_client ? "Client" : "Server") << " received " diff --git a/src/core/tsi/ssl/key_logging/ssl_key_logging.cc b/src/core/tsi/ssl/key_logging/ssl_key_logging.cc index e1a496cc519..4782dafb443 100644 --- a/src/core/tsi/ssl/key_logging/ssl_key_logging.cc +++ b/src/core/tsi/ssl/key_logging/ssl_key_logging.cc @@ -17,8 +17,8 @@ #include #include "absl/log/check.h" +#include "absl/log/log.h" -#include #include #include "src/core/lib/gprpp/crash.h" @@ -54,10 +54,8 @@ TlsSessionKeyLoggerCache::TlsSessionKeyLogger::TlsSessionKeyLogger( fd_ = fopen(tls_session_key_log_file_path_.c_str(), "a"); if (fd_ == nullptr) { grpc_error_handle error = GRPC_OS_ERROR(errno, "fopen"); - gpr_log(GPR_ERROR, - "Ignoring TLS Key logging. ERROR Opening TLS Keylog " - "file: %s", - grpc_core::StatusToString(error).c_str()); + LOG(ERROR) << "Ignoring TLS Key logging. ERROR Opening TLS Keylog file: " + << grpc_core::StatusToString(error); } cache_->tls_session_key_logger_map_.emplace(tls_session_key_log_file_path_, this); @@ -89,8 +87,8 @@ void TlsSessionKeyLoggerCache::TlsSessionKeyLogger::LogSessionKeys( if (err) { grpc_error_handle error = GRPC_OS_ERROR(errno, "fwrite"); - gpr_log(GPR_ERROR, "Error Appending to TLS session key log file: %s", - grpc_core::StatusToString(error).c_str()); + LOG(ERROR) << "Error Appending to TLS session key log file: " + << grpc_core::StatusToString(error); fclose(fd_); fd_ = nullptr; // disable future attempts to write to this file } else { diff --git a/src/core/tsi/ssl_transport_security.cc b/src/core/tsi/ssl_transport_security.cc index fcd1b0658b1..b468ea0e1d1 100644 --- a/src/core/tsi/ssl_transport_security.cc +++ b/src/core/tsi/ssl_transport_security.cc @@ -228,8 +228,9 @@ static void init_openssl(void) { static void ssl_log_where_info(const SSL* ssl, int where, int flag, const char* msg) { if ((where & flag) && GRPC_TRACE_FLAG_ENABLED(tsi)) { - gpr_log(GPR_INFO, "%20.20s - %30.30s - %5.10s", msg, - SSL_state_string_long(ssl), SSL_state_string(ssl)); + LOG(INFO) << absl::StrFormat("%20.20s - %30.30s - %5.10s", msg, + SSL_state_string_long(ssl), + SSL_state_string(ssl)); } } @@ -978,10 +979,10 @@ static grpc_core::experimental::CrlProvider* GetCrlProvider( if (ssl_index < 0) { char err_str[256]; ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str)); - gpr_log(GPR_INFO, - "error getting the SSL index from the X509_STORE_CTX while looking " - "up Crl: %s", - err_str); + LOG(INFO) + << "error getting the SSL index from the X509_STORE_CTX while looking " + "up Crl: " + << err_str; return nullptr; } SSL* ssl = static_cast(X509_STORE_CTX_get_ex_data(ctx, ssl_index)); @@ -1519,8 +1520,7 @@ static tsi_result ssl_handshaker_result_create_frame_protector( protector_impl->buffer = static_cast(gpr_malloc(protector_impl->buffer_size)); if (protector_impl->buffer == nullptr) { - gpr_log(GPR_ERROR, - "Could not allocated buffer for tsi_ssl_frame_protector."); + LOG(ERROR) << "Could not allocate buffer for tsi_ssl_frame_protector."; gpr_free(protector_impl); return TSI_INTERNAL_ERROR; } @@ -1647,8 +1647,8 @@ static tsi_result ssl_handshaker_do_handshake(tsi_ssl_handshaker* impl, default: { char err_str[256]; ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str)); - gpr_log(GPR_ERROR, "Handshake failed with fatal error %s: %s.", - grpc_core::SslErrorString(ssl_result), err_str); + LOG(ERROR) << "Handshake failed with fatal error " + << grpc_core::SslErrorString(ssl_result) << ": " << err_str; if (error != nullptr) { *error = absl::StrCat(grpc_core::SslErrorString(ssl_result), ": ", err_str); @@ -1712,8 +1712,8 @@ static tsi_result ssl_bytes_remaining(tsi_ssl_handshaker* impl, // If an unexpected number of bytes were read, return an error status and // free all of the bytes that were read. if (bytes_read < 0 || static_cast(bytes_read) != bytes_in_ssl) { - gpr_log(GPR_ERROR, - "Failed to read the expected number of bytes from SSL object."); + LOG(ERROR) + << "Failed to read the expected number of bytes from SSL object."; gpr_free(*bytes_remaining); *bytes_remaining = nullptr; if (error != nullptr) { @@ -1896,8 +1896,8 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client, if (server_name_indication != nullptr && !looks_like_ip_address(server_name_indication)) { if (!SSL_set_tlsext_host_name(ssl, server_name_indication)) { - gpr_log(GPR_ERROR, "Invalid server name indication %s.", - server_name_indication); + LOG(ERROR) << "Invalid server name indication " + << server_name_indication; SSL_free(ssl); BIO_free(network_io); return TSI_INTERNAL_ERROR; @@ -1913,9 +1913,9 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client, ssl_result = SSL_do_handshake(ssl); ssl_result = SSL_get_error(ssl, ssl_result); if (ssl_result != SSL_ERROR_WANT_READ) { - gpr_log(GPR_ERROR, - "Unexpected error received from first SSL_do_handshake call: %s", - grpc_core::SslErrorString(ssl_result)); + LOG(ERROR) + << "Unexpected error received from first SSL_do_handshake call: " + << grpc_core::SslErrorString(ssl_result); SSL_free(ssl); BIO_free(network_io); return TSI_INTERNAL_ERROR; diff --git a/src/core/tsi/ssl_transport_security_utils.cc b/src/core/tsi/ssl_transport_security_utils.cc index 18404627691..74764e84b73 100644 --- a/src/core/tsi/ssl_transport_security_utils.cc +++ b/src/core/tsi/ssl_transport_security_utils.cc @@ -109,9 +109,8 @@ tsi_result DoSslRead(SSL* ssl, unsigned char* unprotected_bytes, *unprotected_bytes_size = 0; return TSI_OK; case SSL_ERROR_WANT_WRITE: - gpr_log( - GPR_ERROR, - "Peer tried to renegotiate SSL connection. This is unsupported."); + LOG(ERROR) + << "Peer tried to renegotiate SSL connection. This is unsupported."; return TSI_UNIMPLEMENTED; case SSL_ERROR_SSL: LOG(ERROR) << "Corruption detected.";