[Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log (#37141)

[Gpr_To_Absl_Logging] Migrating from gpr to absl logging - gpr_log
In this CL we are migrating from gRPCs own gpr logging mechanism to absl logging mechanism. The intention is to deprecate gpr_log in the future.

We have the following mapping

1. gpr_log(GPR_INFO,...) -> LOG(INFO)
2. gpr_log(GPR_ERROR,...) -> LOG(ERROR)
3. gpr_log(GPR_DEBUG,...) -> VLOG(2)

Reviewers need to check :

1. If the above mapping is correct.
2. The content of the log is as before.
gpr_log format strings did not use string_view or std::string . absl LOG accepts these. So there will be some elimination of string_view and std::string related conversions. This is expected.

Closes #37141

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37141 from tanvi-jagtap:src_core_resolver_server bb2bf0de50
PiperOrigin-RevId: 649385274
pull/37150/head
Tanvi Jagtap 5 months ago committed by Copybara-Service
parent 1761685fc1
commit 8e9e3f7f25
  1. 38
      src/core/resolver/dns/c_ares/grpc_ares_wrapper.cc
  2. 12
      src/core/resolver/dns/c_ares/grpc_ares_wrapper.h
  3. 9
      src/core/resolver/dns/event_engine/event_engine_client_channel_resolver.cc
  4. 13
      src/core/resolver/dns/native/dns_resolver.cc
  5. 61
      src/core/resolver/xds/xds_resolver.cc
  6. 32
      src/core/server/server.cc
  7. 49
      src/core/server/xds_server_config_fetcher.cc

@ -19,7 +19,6 @@
#include <algorithm>
#include <vector>
#include "absl/log/log.h"
#include "absl/strings/string_view.h"
#include <grpc/impl/channel_arg_names.h>
@ -48,13 +47,13 @@
#include <ares.h>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
@ -556,12 +555,11 @@ static void log_address_sorting_list(const grpc_ares_request* r,
const char* input_output_str) {
for (size_t i = 0; i < addresses.size(); i++) {
auto addr_str = grpc_sockaddr_to_string(&addresses[i].address(), true);
gpr_log(GPR_INFO,
"(c-ares resolver) request:%p c-ares address sorting: %s[%" PRIuPTR
"]=%s",
r, input_output_str, i,
addr_str.ok() ? addr_str->c_str()
: addr_str.status().ToString().c_str());
LOG(INFO) << "(c-ares resolver) request:" << r
<< " c-ares address sorting: " << input_output_str << "[" << i
<< "]="
<< (addr_str.ok() ? addr_str->c_str()
: addr_str.status().ToString().c_str());
}
}
@ -901,18 +899,14 @@ static bool inner_resolve_as_ip_literal_locked(
std::unique_ptr<grpc_core::EndpointAddressesList>* addrs, std::string* host,
std::string* port, std::string* hostport) {
if (!grpc_core::SplitHostPort(name, host, port)) {
gpr_log(GPR_ERROR,
"Failed to parse %s to host:port while attempting to resolve as ip "
"literal.",
name);
LOG(ERROR) << "Failed to parse " << name
<< " to host:port while attempting to resolve as ip literal.";
return false;
}
if (port->empty()) {
if (default_port == nullptr || strlen(default_port) == 0) {
gpr_log(GPR_ERROR,
"No port or default port for %s while attempting to resolve as "
"ip literal.",
name);
LOG(ERROR) << "No port or default port for " << name
<< " while attempting to resolve as ip literal.";
return false;
}
*port = default_port;
@ -964,18 +958,14 @@ static bool inner_maybe_resolve_localhost_manually_locked(
std::string* port) {
grpc_core::SplitHostPort(name, host, port);
if (host->empty()) {
gpr_log(GPR_ERROR,
"Failed to parse %s into host:port during manual localhost "
"resolution check.",
name);
LOG(ERROR) << "Failed to parse " << name
<< " into host:port during manual localhost resolution check.";
return false;
}
if (port->empty()) {
if (default_port == nullptr || strlen(default_port) == 0) {
gpr_log(GPR_ERROR,
"No port or default port for %s during manual localhost "
"resolution check.",
name);
LOG(ERROR) << "No port or default port for " << name
<< " during manual localhost resolution check.";
return false;
}
*port = default_port;

@ -26,8 +26,8 @@
#include <ares.h>
#include "absl/base/thread_annotations.h"
#include "absl/log/log.h"
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/debug/trace.h"
@ -39,11 +39,11 @@
#define GRPC_DNS_ARES_DEFAULT_QUERY_TIMEOUT_MS 120000
#define GRPC_CARES_TRACE_LOG(format, ...) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { \
gpr_log(GPR_DEBUG, "(c-ares resolver) " format, __VA_ARGS__); \
} \
#define GRPC_CARES_TRACE_LOG(format, ...) \
do { \
if (GRPC_TRACE_FLAG_ENABLED(cares_resolver)) { \
VLOG(2) << "(c-ares resolver) " << absl::StrFormat(format, __VA_ARGS__); \
} \
} while (0)
typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;

@ -36,7 +36,6 @@
#include <grpc/event_engine/event_engine.h>
#include <grpc/impl/channel_arg_names.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/backoff/backoff.h"
@ -78,10 +77,10 @@ using grpc_event_engine::experimental::EventEngine;
// TODO(hork): Add a test that checks for proper authority from balancer
// addresses.
#define GRPC_EVENT_ENGINE_RESOLVER_TRACE(format, ...) \
if (GRPC_TRACE_FLAG_ENABLED(event_engine_client_channel_resolver)) { \
gpr_log(GPR_DEBUG, "(event_engine client channel resolver) " format, \
__VA_ARGS__); \
#define GRPC_EVENT_ENGINE_RESOLVER_TRACE(format, ...) \
if (GRPC_TRACE_FLAG_ENABLED(event_engine_client_channel_resolver)) { \
VLOG(2) << "(event_engine client channel resolver) " \
<< absl::StrFormat(format, __VA_ARGS__); \
}
// ----------------------------------------------------------------------------

@ -29,7 +29,6 @@
#include "absl/types/optional.h"
#include <grpc/impl/channel_arg_names.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/backoff/backoff.h"
@ -92,13 +91,13 @@ NativeClientChannelDNSResolver::NativeClientChannelDNSResolver(
GRPC_DNS_RECONNECT_MAX_BACKOFF_SECONDS * 1000)),
&dns_resolver_trace) {
if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) {
gpr_log(GPR_DEBUG, "[dns_resolver=%p] created", this);
VLOG(2) << "[dns_resolver=" << this << "] created";
}
}
NativeClientChannelDNSResolver::~NativeClientChannelDNSResolver() {
if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) {
gpr_log(GPR_DEBUG, "[dns_resolver=%p] destroyed", this);
VLOG(2) << "[dns_resolver=" << this << "] destroyed";
}
}
@ -109,8 +108,8 @@ OrphanablePtr<Orphanable> NativeClientChannelDNSResolver::StartRequest() {
name_to_resolve(), kDefaultSecurePort, kDefaultDNSRequestTimeout,
interested_parties(), /*name_server=*/"");
if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) {
gpr_log(GPR_DEBUG, "[dns_resolver=%p] starting request=%p", this,
DNSResolver::HandleToString(dns_request_handle).c_str());
VLOG(2) << "[dns_resolver=" << this << "] starting request="
<< DNSResolver::HandleToString(dns_request_handle);
}
return MakeOrphanable<Request>();
}
@ -118,8 +117,8 @@ OrphanablePtr<Orphanable> NativeClientChannelDNSResolver::StartRequest() {
void NativeClientChannelDNSResolver::OnResolved(
absl::StatusOr<std::vector<grpc_resolved_address>> addresses_or) {
if (GRPC_TRACE_FLAG_ENABLED(dns_resolver)) {
gpr_log(GPR_DEBUG, "[dns_resolver=%p] request complete, status=\"%s\"",
this, addresses_or.status().ToString().c_str());
VLOG(2) << "[dns_resolver=" << this
<< "] request complete, status=" << addresses_or.status();
}
// Convert result from iomgr DNS API into Resolver::Result.
Result result;

@ -27,6 +27,7 @@
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/meta/type_traits.h"
#include "absl/random/random.h"
#include "absl/status/status.h"
@ -45,7 +46,6 @@
#include <grpc/impl/channel_arg_names.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/client_channel/client_channel_internal.h"
@ -111,16 +111,15 @@ class XdsResolver final : public Resolver {
data_plane_authority_(std::move(data_plane_authority)),
channel_id_(absl::Uniform<uint64_t>(absl::BitGen())) {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(
GPR_INFO,
"[xds_resolver %p] created for URI %s; data plane authority is %s",
this, uri_.ToString().c_str(), data_plane_authority_.c_str());
LOG(INFO) << "[xds_resolver " << this << "] created for URI "
<< uri_.ToString() << "; data plane authority is "
<< data_plane_authority_;
}
}
~XdsResolver() override {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] destroyed", this);
LOG(INFO) << "[xds_resolver " << this << "] destroyed";
}
}
@ -538,8 +537,8 @@ absl::Status XdsResolver::RouteConfigData::AddRouteEntry(
XdsResolver* resolver, const XdsRouteConfigResource::Route& route,
const Duration& default_max_stream_duration) {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] XdsConfigSelector %p: route: %s",
resolver, this, route.ToString().c_str());
LOG(INFO) << "[xds_resolver " << resolver << "] XdsConfigSelector " << this
<< ": route: " << route.ToString();
}
routes_.emplace_back(route);
auto* route_entry = &routes_.back();
@ -630,8 +629,8 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
: resolver_(std::move(resolver)),
route_config_data_(std::move(route_config_data)) {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] creating XdsConfigSelector %p",
resolver_.get(), this);
LOG(INFO) << "[xds_resolver " << resolver_.get()
<< "] creating XdsConfigSelector " << this;
}
// Populate filter list.
const auto& http_filter_registry =
@ -653,8 +652,8 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] destroying XdsConfigSelector %p",
resolver_.get(), this);
LOG(INFO) << "[xds_resolver " << resolver_.get()
<< "] destroying XdsConfigSelector " << this;
}
route_config_data_.reset();
if (!IsWorkSerializerDispatchEnabled()) {
@ -897,10 +896,9 @@ void XdsResolver::StartLocked() {
auto xds_client =
GrpcXdsClient::GetOrCreate(uri_.ToString(), args_, "xds resolver");
if (!xds_client.ok()) {
gpr_log(GPR_ERROR,
"Failed to create xds client -- channel will remain in "
"TRANSIENT_FAILURE: %s",
xds_client.status().ToString().c_str());
LOG(ERROR) << "Failed to create xds client -- channel will remain in "
"TRANSIENT_FAILURE: "
<< xds_client.status();
absl::Status status = absl::UnavailableError(absl::StrCat(
"Failed to create XdsClient: ", xds_client.status().message()));
Result result;
@ -956,8 +954,8 @@ void XdsResolver::StartLocked() {
absl::StrReplaceAll(name_template, {{"%s", resource_name_fragment}});
}
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] Started with lds_resource_name %s.",
this, lds_resource_name_.c_str());
LOG(INFO) << "[xds_resolver " << this << "] Started with lds_resource_name "
<< lds_resource_name_;
}
// Start watch for xDS config.
dependency_mgr_ = MakeOrphanable<XdsDependencyManager>(
@ -968,7 +966,7 @@ void XdsResolver::StartLocked() {
void XdsResolver::ShutdownLocked() {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] shutting down", this);
LOG(INFO) << "[xds_resolver " << this << "] shutting down";
}
if (xds_client_ != nullptr) {
dependency_mgr_.reset();
@ -981,7 +979,7 @@ void XdsResolver::ShutdownLocked() {
void XdsResolver::OnUpdate(
RefCountedPtr<const XdsDependencyManager::XdsConfig> config) {
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] received updated xDS config", this);
LOG(INFO) << "[xds_resolver " << this << "] received updated xDS config";
}
if (xds_client_ == nullptr) return;
current_config_ = std::move(config);
@ -989,8 +987,9 @@ void XdsResolver::OnUpdate(
}
void XdsResolver::OnError(absl::string_view context, absl::Status status) {
gpr_log(GPR_ERROR, "[xds_resolver %p] received error from XdsClient: %s: %s",
this, std::string(context).c_str(), status.ToString().c_str());
LOG(ERROR) << "[xds_resolver " << this
<< "] received error from XdsClient: " << context << ": "
<< status;
if (xds_client_ == nullptr) return;
status =
absl::UnavailableError(absl::StrCat(context, ": ", status.ToString()));
@ -1003,10 +1002,9 @@ void XdsResolver::OnError(absl::string_view context, absl::Status status) {
}
void XdsResolver::OnResourceDoesNotExist(std::string context) {
gpr_log(GPR_ERROR,
"[xds_resolver %p] LDS/RDS resource does not exist -- clearing "
"update and returning empty service config",
this);
LOG(ERROR) << "[xds_resolver " << this
<< "] LDS/RDS resource does not exist -- clearing "
"update and returning empty service config";
if (xds_client_ == nullptr) return;
current_config_.reset();
Result result;
@ -1080,10 +1078,10 @@ void XdsResolver::GenerateResult() {
result.addresses.emplace();
result.service_config = CreateServiceConfig();
if (GRPC_TRACE_FLAG_ENABLED(xds_resolver)) {
gpr_log(GPR_INFO, "[xds_resolver %p] generated service config: %s", this,
result.service_config.ok()
? std::string((*result.service_config)->json_string()).c_str()
: result.service_config.status().ToString().c_str());
LOG(INFO) << "[xds_resolver " << this << "] generated service config: "
<< (result.service_config.ok()
? ((*result.service_config)->json_string())
: result.service_config.status().ToString());
}
result.args =
args_.SetObject(xds_client_.Ref(DEBUG_LOCATION, "xds resolver result"))
@ -1117,8 +1115,7 @@ class XdsResolverFactory final : public ResolverFactory {
bool IsValidUri(const URI& uri) const override {
if (uri.path().empty() || uri.path().back() == '/') {
gpr_log(GPR_ERROR,
"URI path does not contain valid data plane authority");
LOG(ERROR) << "URI path does not contain valid data plane authority";
return false;
}
return true;

@ -43,7 +43,6 @@
#include <grpc/impl/connectivity_state.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
@ -1050,19 +1049,18 @@ Server::RegisteredMethod* Server::RegisterMethod(
}
if (!method) {
gpr_log(GPR_ERROR,
"grpc_server_register_method method string cannot be NULL");
LOG(ERROR) << "grpc_server_register_method method string cannot be NULL";
return nullptr;
}
auto key = std::make_pair(host ? host : "", method);
if (registered_methods_.find(key) != registered_methods_.end()) {
gpr_log(GPR_ERROR, "duplicate registration for %s@%s", method,
host ? host : "*");
LOG(ERROR) << "duplicate registration for " << method << "@"
<< (host ? host : "*");
return nullptr;
}
if (flags != 0) {
gpr_log(GPR_ERROR, "grpc_server_register_method invalid flags 0x%08x",
flags);
LOG(ERROR) << "grpc_server_register_method invalid flags "
<< absl::StrFormat("0x%08x", flags);
return nullptr;
}
auto it = registered_methods_.emplace(
@ -1100,12 +1098,11 @@ void Server::MaybeFinishShutdown() {
last_shutdown_message_time_),
gpr_time_from_seconds(1, GPR_TIMESPAN)) >= 0) {
last_shutdown_message_time_ = gpr_now(GPR_CLOCK_REALTIME);
gpr_log(GPR_DEBUG,
"Waiting for %" PRIuPTR " channels %" PRIuPTR
" connections and %" PRIuPTR "/%" PRIuPTR
" listeners to be destroyed before shutting down server",
channels_.size(), connections_open_,
listeners_.size() - listeners_destroyed_, listeners_.size());
VLOG(2) << "Waiting for " << channels_.size() << " channels "
<< connections_open_ << " connections and "
<< listeners_.size() - listeners_destroyed_ << "/"
<< listeners_.size()
<< " listeners to be destroyed before shutting down server";
}
return;
}
@ -1673,8 +1670,7 @@ void Server::CallData::RecvInitialMetadataBatchComplete(
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
auto* calld = static_cast<Server::CallData*>(elem->call_data);
if (!error.ok()) {
gpr_log(GPR_DEBUG, "Failed call creation: %s",
StatusToString(error).c_str());
VLOG(2) << "Failed call creation: " << StatusToString(error);
calld->FailCallCreation();
return;
}
@ -1798,10 +1794,8 @@ void grpc_server_register_completion_queue(grpc_server* server,
CHECK(!reserved);
auto cq_type = grpc_get_cq_completion_type(cq);
if (cq_type != GRPC_CQ_NEXT && cq_type != GRPC_CQ_CALLBACK) {
gpr_log(GPR_INFO,
"Completion queue of type %d is being registered as a "
"server-completion-queue",
static_cast<int>(cq_type));
LOG(INFO) << "Completion queue of type " << static_cast<int>(cq_type)
<< " is being registered as a server-completion-queue";
// Ideally we should log an error and abort but ruby-wrapped-language API
// calls grpc_completion_queue_pluck() on server completion queues
}

@ -28,6 +28,7 @@
#include "absl/base/thread_annotations.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/match.h"
@ -44,7 +45,6 @@
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include "src/core/lib/address_utils/parse_address.h"
@ -588,9 +588,9 @@ void XdsServerConfigFetcher::ListenerWatcher::OnResourceChanged(
std::shared_ptr<const XdsListenerResource> listener,
RefCountedPtr<ReadDelayHandle> /* read_delay_handle */) {
if (GRPC_TRACE_FLAG_ENABLED(xds_server_config_fetcher)) {
gpr_log(GPR_INFO,
"[ListenerWatcher %p] Received LDS update from xds client %p: %s",
this, xds_client_.get(), listener->ToString().c_str());
LOG(INFO) << "[ListenerWatcher " << this
<< "] Received LDS update from xds client " << xds_client_.get()
<< ": " << listener->ToString();
}
auto* tcp_listener =
absl::get_if<XdsListenerResource::TcpListener>(&listener->listener);
@ -628,20 +628,19 @@ void XdsServerConfigFetcher::ListenerWatcher::OnError(
MutexLock lock(&mu_);
if (filter_chain_match_manager_ != nullptr ||
pending_filter_chain_match_manager_ != nullptr) {
gpr_log(GPR_ERROR,
"ListenerWatcher:%p XdsClient reports error: %s for %s; "
"ignoring in favor of existing resource",
this, status.ToString().c_str(), listening_address_.c_str());
LOG(ERROR) << "ListenerWatcher:" << this
<< " XdsClient reports error: " << status << " for "
<< listening_address_
<< "; ignoring in favor of existing resource";
} else {
if (serving_status_notifier_.on_serving_status_update != nullptr) {
serving_status_notifier_.on_serving_status_update(
serving_status_notifier_.user_data, listening_address_.c_str(),
{GRPC_STATUS_UNAVAILABLE, status.ToString().c_str()});
} else {
gpr_log(GPR_ERROR,
"ListenerWatcher:%p error obtaining xDS Listener resource: %s; "
"not serving on %s",
this, status.ToString().c_str(), listening_address_.c_str());
LOG(ERROR) << "ListenerWatcher:" << this
<< " error obtaining xDS Listener resource: " << status
<< "; not serving on " << listening_address_;
}
}
}
@ -661,9 +660,8 @@ void XdsServerConfigFetcher::ListenerWatcher::OnFatalError(
{static_cast<grpc_status_code>(status.raw_code()),
std::string(status.message()).c_str()});
} else {
gpr_log(GPR_ERROR,
"ListenerWatcher:%p Encountered fatal error %s; not serving on %s",
this, status.ToString().c_str(), listening_address_.c_str());
LOG(ERROR) << "ListenerWatcher:" << this << " Encountered fatal error "
<< status << "; not serving on " << listening_address_;
}
}
@ -689,9 +687,8 @@ void XdsServerConfigFetcher::ListenerWatcher::
serving_status_notifier_.user_data, listening_address_.c_str(),
{GRPC_STATUS_OK, ""});
} else {
gpr_log(GPR_INFO,
"xDS Listener resource obtained; will start serving on %s",
listening_address_.c_str());
LOG(INFO) << "xDS Listener resource obtained; will start serving on "
<< listening_address_;
}
}
// Promote the pending FilterChainMatchManager
@ -996,8 +993,8 @@ const XdsListenerResource::FilterChainData* FindFilterChainDataForSourceType(
}
auto source_addr = StringToSockaddr(host, 0); // Port doesn't matter here.
if (!source_addr.ok()) {
gpr_log(GPR_DEBUG, "Could not parse \"%s\" as socket address: %s",
host.c_str(), source_addr.status().ToString().c_str());
VLOG(2) << "Could not parse \"" << host
<< "\" as socket address: " << source_addr.status();
return nullptr;
}
// Use kAny only if kSameIporLoopback and kExternal are empty
@ -1045,8 +1042,8 @@ const XdsListenerResource::FilterChainData* FindFilterChainDataForDestinationIp(
auto destination_addr =
StringToSockaddr(host, 0); // Port doesn't matter here.
if (!destination_addr.ok()) {
gpr_log(GPR_DEBUG, "Could not parse \"%s\" as socket address: %s",
host.c_str(), destination_addr.status().ToString().c_str());
VLOG(2) << "Could not parse \"" << host
<< "\" as socket address: " << destination_addr.status();
return nullptr;
}
const XdsListenerResource::FilterChainMap::DestinationIp* best_match =
@ -1376,17 +1373,15 @@ grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create(
grpc_core::GrpcXdsClient::kServerKey, channel_args,
"XdsServerConfigFetcher");
if (!xds_client.ok()) {
gpr_log(GPR_ERROR, "Failed to create xds client: %s",
xds_client.status().ToString().c_str());
LOG(ERROR) << "Failed to create xds client: " << xds_client.status();
return nullptr;
}
if (static_cast<const grpc_core::GrpcXdsBootstrap&>(
(*xds_client)->bootstrap())
.server_listener_resource_name_template()
.empty()) {
gpr_log(GPR_ERROR,
"server_listener_resource_name_template not provided in bootstrap "
"file.");
LOG(ERROR) << "server_listener_resource_name_template not provided in "
"bootstrap file.";
return nullptr;
}
return new grpc_core::XdsServerConfigFetcher(std::move(*xds_client),

Loading…
Cancel
Save