From 6113d225e9eabebb855c86b420744f3eeded6f40 Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Wed, 20 Aug 2025 13:56:58 -0700 Subject: [PATCH] Move unnecessary INFO logs to VLOG. PiperOrigin-RevId: 797451961 --- .../analytics/analytics_recorder.cc | 2 +- connections/implementation/client_proxy.cc | 2 +- .../implementation/endpoint_manager.cc | 8 +++--- .../service_controller_router.cc | 5 +--- internal/data/leveldb_data_set.h | 18 ++++++------- .../windows/preferences_repository.cc | 2 +- .../implementation/windows/task_scheduler.cc | 26 +++++++++---------- .../windows/wifi_lan_server_socket.cc | 4 +-- .../nearby_share_certificate_manager_impl.cc | 8 +++--- .../nearby_fast_initiation_impl.cc | 4 +-- 10 files changed, 38 insertions(+), 41 deletions(-) diff --git a/connections/implementation/analytics/analytics_recorder.cc b/connections/implementation/analytics/analytics_recorder.cc index 6a98c7bd..2f352045 100644 --- a/connections/implementation/analytics/analytics_recorder.cc +++ b/connections/implementation/analytics/analytics_recorder.cc @@ -164,7 +164,7 @@ OperationResultCategory ConvertToOperationResultCategory( AnalyticsRecorder::AnalyticsRecorder(EventLogger *event_logger) : event_logger_(event_logger) { - LOG(INFO) << "Start AnalyticsRecorder ctor event_logger_=" << event_logger_; + VLOG(1) << "Start AnalyticsRecorder ctor event_logger_=" << event_logger_; LogStartSession(); } diff --git a/connections/implementation/client_proxy.cc b/connections/implementation/client_proxy.cc index 4913a147..9ba2ddbe 100644 --- a/connections/implementation/client_proxy.cc +++ b/connections/implementation/client_proxy.cc @@ -89,7 +89,7 @@ bool IsFeatureUseStableEndpointIdEnabled() { ClientProxy::ClientProxy(::nearby::analytics::EventLogger* event_logger) : client_id_(Prng().NextInt64()) { - LOG(INFO) << "ClientProxy ctor event_logger=" << event_logger; + VLOG(1) << "ClientProxy ctor event_logger=" << event_logger; is_dct_enabled_ = NearbyFlags::GetInstance().GetBoolFlag( config_package_nearby::nearby_connections_feature::kEnableDct); analytics_recorder_ = diff --git a/connections/implementation/endpoint_manager.cc b/connections/implementation/endpoint_manager.cc index ecca6b82..7712e269 100644 --- a/connections/implementation/endpoint_manager.cc +++ b/connections/implementation/endpoint_manager.cc @@ -476,10 +476,10 @@ void EndpointManager::RegisterFrameProcessor( frame_processor.set(processor); } else { MutexLock lock(&frame_processors_lock_); - LOG(INFO) << "EndpointManager received request to add registration " - "of frame processor " - << processor << " for frame type " - << V1Frame::FrameType_Name(frame_type) << ", self=" << this; + VLOG(1) << "EndpointManager received request to add registration " + "of frame processor " + << processor << " for frame type " + << V1Frame::FrameType_Name(frame_type) << ", self=" << this; frame_processors_.emplace(frame_type, processor); } } diff --git a/connections/implementation/service_controller_router.cc b/connections/implementation/service_controller_router.cc index 96a465e9..b582edae 100644 --- a/connections/implementation/service_controller_router.cc +++ b/connections/implementation/service_controller_router.cc @@ -96,10 +96,7 @@ ServiceControllerRouter::ServiceControllerRouter() { ServiceControllerRouter::ServiceControllerRouter( absl::AnyInvocable if_hp_realtek_device) - : if_hp_realtek_device_(std::move(if_hp_realtek_device)) { - LOG(INFO) - << "ServiceControllerRouter going up checking if_hp_realtek_device."; -} + : if_hp_realtek_device_(std::move(if_hp_realtek_device)) {} // Constructor called by the CrOS platform implementation to override the // kEnableBleV2 flag. diff --git a/internal/data/leveldb_data_set.h b/internal/data/leveldb_data_set.h index a341acfd..02de34f4 100644 --- a/internal/data/leveldb_data_set.h +++ b/internal/data/leveldb_data_set.h @@ -98,11 +98,11 @@ void LeveldbDataSet::Initialize( LOG(INFO) << "Database is initialized successfully.."; } else if (status.IsCorruption() || status.IsIOError()) { status_ = InitStatus::kCorrupt; - LOG(INFO) << "Database is corrupt."; + LOG(WARNING) << "Database is corrupt."; } else { status_ = InitStatus::kError; - LOG(INFO) << "Failed to initialize database due to unknown error."; + LOG(ERROR) << "Failed to initialize database due to unknown error."; } std::move(callback)(status_); } @@ -129,10 +129,10 @@ void LeveldbDataSet::LoadEntries( } if (it->status().ok()) { - LOG(INFO) << "Loaded " << result->size() << " entries from database."; + VLOG(1) << "Loaded " << result->size() << " entries from database."; std::move(callback)(true, std::move(result)); } else { - LOG(INFO) << "Failed to load entries from database."; + LOG(ERROR) << "Failed to load entries from database."; result->clear(); std::move(callback)(false, std::move(result)); } @@ -152,7 +152,7 @@ void LeveldbDataSet::LoadEntry( std::string value; if (!db_->Get(leveldb::ReadOptions(), std::string(key), &value).ok()) { - LOG(INFO) << "Failed to load entry from database with key: " << key; + LOG(WARNING) << "Failed to load entry from database with key: " << key; std::move(callback)(false, std::move(result)); return; } @@ -183,10 +183,10 @@ void LeveldbDataSet::LoadEntriesWithKeys( } if (it->status().ok()) { - LOG(INFO) << "Loaded " << result->size() << " entries from database."; + VLOG(1) << "Loaded " << result->size() << " entries from database."; std::move(callback)(true, std::move(result)); } else { - LOG(INFO) << "Failed to load entries from database."; + LOG(WARNING) << "Failed to load entries from database."; result->clear(); std::move(callback)(false, std::move(result)); } @@ -199,7 +199,7 @@ void LeveldbDataSet::UpdateEntries( std::unique_ptr entries_to_save, std::unique_ptr> keys_to_remove, absl::AnyInvocable callback) { - LOG(INFO) << "UpdateEntries is called."; + VLOG(1) << "UpdateEntries is called."; if (status_ != InitStatus::kOK) { std::move(callback)(false); return; @@ -227,7 +227,7 @@ template void LeveldbDataSet::Destroy( absl::AnyInvocable callback) { - LOG(INFO) << "Destroy is called."; + VLOG(1) << "Destroy is called."; db_.reset(); leveldb::DestroyDB(path_, db_options_); std::move(callback)(true); diff --git a/internal/platform/implementation/windows/preferences_repository.cc b/internal/platform/implementation/windows/preferences_repository.cc index d904abff..93772a63 100644 --- a/internal/platform/implementation/windows/preferences_repository.cc +++ b/internal/platform/implementation/windows/preferences_repository.cc @@ -81,7 +81,7 @@ bool PreferencesRepository::SavePreferences(json preferences) { // Create a backup without moving the bytes on disk if (Files::FileExists(full_name)) { - LOG(INFO) << "Making backup of preferences file."; + VLOG(1) << "Making backup of preferences file."; if (!Files::Rename(full_name, full_name_backup)) { LOG(ERROR) << "Failed to rename preferences backup file."; } diff --git a/internal/platform/implementation/windows/task_scheduler.cc b/internal/platform/implementation/windows/task_scheduler.cc index cfc08f43..39d2b483 100644 --- a/internal/platform/implementation/windows/task_scheduler.cc +++ b/internal/platform/implementation/windows/task_scheduler.cc @@ -37,12 +37,12 @@ void CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired) { } // namespace TaskScheduler::TaskScheduler() { - LOG(INFO) << __func__ << ": Created task scheduler: " << this; + VLOG(1) << __func__ << ": Created task scheduler: " << this; } TaskScheduler::~TaskScheduler() { Shutdown(); - LOG(INFO) << __func__ << ": Destroyed task scheduler: " << this; + VLOG(1) << __func__ << ": Destroyed task scheduler: " << this; } std::shared_ptr TaskScheduler::Schedule( @@ -54,10 +54,10 @@ std::shared_ptr TaskScheduler::Schedule( Runnable&& runnable, absl::Duration duration, absl::Duration repeat_interval) { absl::MutexLock lock(&mutex_); - LOG(INFO) << __func__ << ": Scheduling task on task scheduler:" << this - << ", duration: " << absl::ToInt64Milliseconds(duration) - << "ms, repeat_interval: " - << absl::ToInt64Milliseconds(repeat_interval) << "ms"; + VLOG(1) << __func__ << ": Scheduling task on task scheduler:" << this + << ", duration: " << absl::ToInt64Milliseconds(duration) + << "ms, repeat_interval: " + << absl::ToInt64Milliseconds(repeat_interval) << "ms"; if (is_shutdown_) { LOG(ERROR) << __func__ << ": Attempt to schedule task on a shut down task " @@ -86,15 +86,15 @@ std::shared_ptr TaskScheduler::Schedule( task->set_timer_handle(reinterpret_cast(timer_handle)); scheduled_tasks_.insert({reinterpret_cast(timer_handle), task}); - LOG(INFO) << __func__ << ": Scheduled task " << task.get() - << " on task scheduler:" << this - << " timer handle: " << task->timer_handle(); + VLOG(1) << __func__ << ": Scheduled task " << task.get() + << " on task scheduler:" << this + << " timer handle: " << task->timer_handle(); return task; } void TaskScheduler::Shutdown() { absl::MutexLock lock(&mutex_); - LOG(INFO) << __func__ << ": Shutting down task scheduler:" << this; + VLOG(1) << __func__ << ": Shutting down task scheduler:" << this; if (is_shutdown_) { return; } @@ -115,7 +115,7 @@ void TaskScheduler::Shutdown() { } scheduled_tasks_.clear(); is_shutdown_ = true; - LOG(INFO) << __func__ << ": Shut down task scheduler:" << this; + VLOG(1) << __func__ << ": Shut down task scheduler:" << this; } TaskScheduler::ScheduledTask::ScheduledTask(TaskScheduler& task_scheduler, @@ -134,8 +134,8 @@ TaskScheduler::ScheduledTask::ScheduledTask(TaskScheduler& task_scheduler, } bool TaskScheduler::ScheduledTask::Cancel() { - LOG(INFO) << __func__ << ": Cancelling timer " << timer_handle() - << " from task scheduler:" << this; + VLOG(1) << __func__ << ": Cancelling timer " << timer_handle() + << " from task scheduler:" << this; { absl::MutexLock lock(&mutex_); if (is_cancelled_) { diff --git a/internal/platform/implementation/windows/wifi_lan_server_socket.cc b/internal/platform/implementation/windows/wifi_lan_server_socket.cc index d3a24c67..7853e0cc 100644 --- a/internal/platform/implementation/windows/wifi_lan_server_socket.cc +++ b/internal/platform/implementation/windows/wifi_lan_server_socket.cc @@ -98,7 +98,7 @@ std::unique_ptr WifiLanServerSocket::Accept() { return std::make_unique(std::move(client_socket)); } else { absl::MutexLock lock(&mutex_); - LOG(INFO) << __func__ << ": Accept is called."; + VLOG(1) << __func__ << ": Accept is called."; while (!closed_ && pending_sockets_.empty()) { cond_.Wait(&mutex_); } @@ -121,7 +121,7 @@ void WifiLanServerSocket::SetCloseNotifier( Exception WifiLanServerSocket::Close() { try { absl::MutexLock lock(&mutex_); - LOG(INFO) << __func__ << ": Close is called."; + VLOG(1) << __func__ << ": Close is called."; if (enable_blocking_socket_) { if (closed_) { return {Exception::kSuccess}; diff --git a/sharing/certificates/nearby_share_certificate_manager_impl.cc b/sharing/certificates/nearby_share_certificate_manager_impl.cc index 27005e5a..f574a3b5 100644 --- a/sharing/certificates/nearby_share_certificate_manager_impl.cc +++ b/sharing/certificates/nearby_share_certificate_manager_impl.cc @@ -240,7 +240,7 @@ NearbyShareCertificateManagerImpl::NearbyShareCertificateManagerImpl( /*require_connectivity=*/false, prefs::kNearbySharingSchedulerPrivateCertificateExpirationName, [this]() { - LOG(INFO) + VLOG(1) << "Private certificate expiration scheduler is called."; executor_->PostTask([this]() { private_certificate_expiration_scheduler_->HandleResult( @@ -256,7 +256,7 @@ NearbyShareCertificateManagerImpl::NearbyShareCertificateManagerImpl( /*require_connectivity=*/false, prefs::kNearbySharingSchedulerPublicCertificateExpirationName, [this]() { - LOG(INFO) + VLOG(1) << ": Public certificate expiration scheduler is called."; executor_->PostTask([this]() { public_certificate_expiration_scheduler_->HandleResult( @@ -271,7 +271,7 @@ NearbyShareCertificateManagerImpl::NearbyShareCertificateManagerImpl( /*require_connectivity=*/true, prefs::kNearbySharingSchedulerUploadLocalDeviceCertificatesName, [this]() { - LOG(INFO) + VLOG(1) << "Upload local device certificates scheduler is called."; executor_->PostTask([this]() { force_contacts_update_scheduler_->HandleResult( @@ -799,7 +799,7 @@ bool NearbyShareCertificateManagerImpl::RefreshPrivateCertificatesInExecutor( force_contacts_update_scheduler_->MakeImmediateRequest(); } else { executor_->PostTask([this]() { - LOG(INFO) << "Begin UploadDeviceCertificatesInExecutor"; + VLOG(1) << "Begin UploadDeviceCertificatesInExecutor"; UploadDeviceCertificatesInExecutor( certificate_storage_->GetPrivateCertificates(), /*force_update_contacts=*/false); diff --git a/sharing/fast_initiation/nearby_fast_initiation_impl.cc b/sharing/fast_initiation/nearby_fast_initiation_impl.cc index 05c666cd..1ba7b48e 100644 --- a/sharing/fast_initiation/nearby_fast_initiation_impl.cc +++ b/sharing/fast_initiation/nearby_fast_initiation_impl.cc @@ -281,11 +281,11 @@ void NearbyFastInitiationImpl::AdvertisingErrorCodeCallbackHandler( void NearbyFastInitiationImpl::AddObserver(Observer* observer) { observer_list_.AddObserver(observer); - LOG(INFO) << __func__ << ": Fast Initiation observer added."; + VLOG(1) << __func__ << ": Fast Initiation observer added."; } void NearbyFastInitiationImpl::RemoveObserver(Observer* observer) { observer_list_.RemoveObserver(observer); - LOG(INFO) << __func__ << ": Fast Initiation observer removed."; + VLOG(1) << __func__ << ": Fast Initiation observer removed."; } bool NearbyFastInitiationImpl::HasObserver(Observer* observer) { return observer_list_.HasObserver(observer);