From 7ac70d64f543104e3257d87e7695a05830f6f214 Mon Sep 17 00:00:00 2001 From: yuunlimm Date: Mon, 17 Jun 2024 16:13:38 -0700 Subject: [PATCH] replace println with tracing --- .cargo/config.toml | 2 +- .../indexer-grpc-data-service/src/config.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 189584de8e2e2..d7681b6c2c0a9 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -17,7 +17,7 @@ x = "run --package aptos-cargo-cli --bin aptos-cargo-cli --" [build] rustflags = ["--cfg", "tokio_unstable", "-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes"] -# TODO(grao): Figure out whether we should enable othaer cpu features, and whether we should use a different way to configure them rather than list every single one here. +# TODO(grao): Figure out whether we should enable other cpu features, and whether we should use a different way to configure them rather than list every single one here. [target.x86_64-unknown-linux-gnu] rustflags = ["--cfg", "tokio_unstable", "-C", "link-arg=-fuse-ld=lld", "-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes", "-C", "target-feature=+sse4.2"] diff --git a/ecosystem/indexer-grpc/indexer-grpc-data-service/src/config.rs b/ecosystem/indexer-grpc/indexer-grpc-data-service/src/config.rs index c5f621fcde703..0181b8a384a3b 100644 --- a/ecosystem/indexer-grpc/indexer-grpc-data-service/src/config.rs +++ b/ecosystem/indexer-grpc/indexer-grpc-data-service/src/config.rs @@ -159,14 +159,14 @@ impl RunnableConfig for IndexerGrpcDataServiceConfig { StorageFormat::Base64UncompressedProto }; - println!( - ">>>> Starting Redis connection: {:?}", - &self.redis_read_replica_address.0 + tracing::info!( + redis_connection_address = &self.redis_read_replica_address.0.to_string(), + "[data service] Starting Redis connection", ); let redis_conn = redis::Client::open(self.redis_read_replica_address.0.clone())? .get_tokio_connection_manager() .await?; - println!(">>>> Redis connection established"); + tracing::info!("[data service] Redis connection established"); // InMemoryCache. let in_memory_cache = aptos_indexer_grpc_utils::in_memory_cache::InMemoryCache::new_with_redis_connection( @@ -175,7 +175,7 @@ impl RunnableConfig for IndexerGrpcDataServiceConfig { cache_storage_format, ) .await?; - println!(">>>> InMemoryCache established"); + tracing::info!("[data service] InMemoryCache established"); // Add authentication interceptor. let server = RawDataServerWrapper::new( self.redis_read_replica_address.clone(), @@ -189,7 +189,7 @@ impl RunnableConfig for IndexerGrpcDataServiceConfig { .send_compressed(CompressionEncoding::Zstd) .accept_compressed(CompressionEncoding::Zstd) .accept_compressed(CompressionEncoding::Gzip); - println!(">>>> Starting gRPC server: {:?}", &svc); + tracing::info!("[data service] Starting gRPC server."); let svc_clone = svc.clone(); let reflection_service_clone = reflection_service.clone();