Skip to content

Commit

Permalink
Remove spammy PA_LOGs.
Browse files Browse the repository at this point in the history
Most usages of PA_LOG(INFO) did not need to be in the default stdout,
and were spammy. This CL downgrades most to VERBOSE, but leaves a choice
few as INFO:
* //chrome/browser/chromeos/tether/tether_service.cc:519
* //chromeos/components/proximity_auth/unlock_manager_impl.cc:219
* //chromeos/components/proximity_auth/unlock_manager_impl.cc:466
* //chromeos/components/tether/active_host_network_state_updater.cc (all)
* //chromeos/services/multidevice_setup/host_backend_delegate_impl.cc:237
* //chromeos/services/secure_channel/ble_connection_manager_impl.cc:261
* //chromeos/services/secure_channel/ble_scanner_impl.cc (all)
* //chromeos/services/secure_channel/secure_channel_impl.cc:132
* //chromeos/services/secure_channel/secure_channel_impl.cc:177
* //components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc (all)
* //components/cryptauth/cryptauth_device_manager_impl.cc:659
* //components/cryptauth/secure_channel.cc:269

Some others which were actually error or unexpected cases have been moved
to WARNING or ERROR.

Bug: 899100
Change-Id: I58c8b734138fcb4c19be940fe79327adebe4d568
Reviewed-on: https://chromium-review.googlesource.com/c/1313762
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: Jeremy Klein <jlklein@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604998}
  • Loading branch information
Ryan Hansberry authored and Commit Bot committed Nov 2, 2018
1 parent f73cba2 commit 8c73296
Show file tree
Hide file tree
Showing 73 changed files with 602 additions and 559 deletions.
12 changes: 6 additions & 6 deletions ash/multi_device_setup/multi_device_notification_presenter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ void MultiDeviceNotificationPresenter::ObserveMultiDeviceSetupIfPossible() {

void MultiDeviceNotificationPresenter::OnNotificationClicked() {
DCHECK(notification_status_ != Status::kNoNotificationVisible);
PA_LOG(INFO) << "User clicked "
<< GetNotificationDescriptionForLogging(notification_status_)
<< ".";
PA_LOG(VERBOSE) << "User clicked "
<< GetNotificationDescriptionForLogging(notification_status_)
<< ".";
UMA_HISTOGRAM_ENUMERATION("MultiDeviceSetup_NotificationClicked",
GetMetricValueForNotification(notification_status_),
kNotificationTypeMax);
Expand All @@ -230,9 +230,9 @@ void MultiDeviceNotificationPresenter::ShowNotification(
const Status notification_status,
const base::string16& title,
const base::string16& message) {
PA_LOG(INFO) << "Showing "
<< GetNotificationDescriptionForLogging(notification_status)
<< ".";
PA_LOG(VERBOSE) << "Showing "
<< GetNotificationDescriptionForLogging(notification_status)
<< ".";
UMA_HISTOGRAM_ENUMERATION("MultiDeviceSetup_NotificationShown",
GetMetricValueForNotification(notification_status),
kNotificationTypeMax);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ void ConnectionEstablisherImpl::SendStartStreamingMessageIfNotConnected(
ConnectionMode connection_mode) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (is_connected_) {
PA_LOG(INFO) << "Connection already exists. Skipped sending start "
"streaming message to service worker.";
PA_LOG(VERBOSE) << "Connection already exists. Skipped sending start "
"streaming message to service worker.";
return;
}

Expand All @@ -58,7 +58,7 @@ void ConnectionEstablisherImpl::SendStartStreamingMessageIfNotConnected(
}
msg.encoded_message = msg.owned_encoded_message;

PA_LOG(INFO) << "Dispatching start streaming message to service worker.";
PA_LOG(VERBOSE) << "Dispatching start streaming message to service worker.";
is_connected_ = true;
service_worker_context->StartServiceWorkerAndDispatchLongRunningMessage(
GetAndroidMessagesURL(), std::move(msg),
Expand All @@ -70,8 +70,9 @@ void ConnectionEstablisherImpl::OnMessageDispatchResult(bool status) {
// When message dispatch result callback is called, it means that the service
// worker resolved it's message handler promise and is not holding a
// background connection.
PA_LOG(INFO) << "Service worker streaming message dispatch returned status: "
<< status;
PA_LOG(VERBOSE)
<< "Service worker streaming message dispatch returned status: "
<< status;
is_connected_ = false;
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/android_sms/connection_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ void ConnectionManager::UpdateAndroidSmsFeatureState(
if (is_android_sms_enabled_ == is_enabled)
return;

PA_LOG(INFO) << "ConnectionManager::UpdateAndroidSmsFeatureState enabled: "
<< is_enabled;
PA_LOG(VERBOSE) << "ConnectionManager::UpdateAndroidSmsFeatureState enabled: "
<< is_enabled;
if (is_enabled) {
connection_establisher_->EstablishConnection(
service_worker_context_,
Expand Down
10 changes: 5 additions & 5 deletions chrome/browser/chromeos/cryptauth/chrome_cryptauth_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ ChromeCryptAuthService::ChromeCryptAuthService(
weak_ptr_factory_.GetWeakPtr()));

if (!identity_manager_->HasPrimaryAccountWithRefreshToken()) {
PA_LOG(INFO) << "Primary account with refresh token not yet available; "
<< "waiting before starting CryptAuth managers.";
PA_LOG(VERBOSE) << "Primary account with refresh token not yet available; "
<< "waiting before starting CryptAuth managers.";
identity_manager_->AddObserver(this);
return;
}
Expand Down Expand Up @@ -185,8 +185,8 @@ void ChromeCryptAuthService::OnEnrollmentFinished(bool success) {

void ChromeCryptAuthService::OnAuthenticationStateChanged() {
if (!identity_manager_->HasPrimaryAccountWithRefreshToken()) {
PA_LOG(INFO) << "Primary account with refresh token not yet available; "
<< "waiting before starting CryptAuth managers.";
PA_LOG(VERBOSE) << "Primary account with refresh token not yet available; "
<< "waiting before starting CryptAuth managers.";
return;
}

Expand All @@ -213,7 +213,7 @@ void ChromeCryptAuthService::PerformEnrollmentAndDeviceSyncIfPossible() {
// the CryptAuth back-end when the registration would never actually be used.
if (!multidevice_setup::AreAnyMultiDeviceFeaturesAllowed(
profile_->GetPrefs())) {
PA_LOG(INFO) << "CryptAuth enrollment is disabled by enterprise policy.";
PA_LOG(VERBOSE) << "CryptAuth enrollment is disabled by enterprise policy.";
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void EasyUnlockChallengeWrapper::OnChannelBindingDataSigned(
wrapped_challenge.set_header_and_body(challenge_);
wrapped_challenge.set_signature(signature_container.SerializeAsString());

PA_LOG(INFO) << "Finished wrapping challenge.";
PA_LOG(VERBOSE) << "Finished wrapping challenge.";
callback_.Run(wrapped_challenge.SerializeAsString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ void EasyUnlockService::AttemptAuth(const AccountId& account_id) {
GetType() == TYPE_REGULAR ? EasyUnlockAuthAttempt::TYPE_UNLOCK
: EasyUnlockAuthAttempt::TYPE_SIGNIN;
if (auth_attempt_) {
PA_LOG(INFO) << "Already attempting auth, skipping this request.";
PA_LOG(VERBOSE) << "Already attempting auth, skipping this request.";
return;
}

Expand Down Expand Up @@ -646,7 +646,7 @@ void EasyUnlockService::SetProximityAuthDevices(
}

if (!proximity_auth_system_) {
PA_LOG(INFO) << "Creating ProximityAuthSystem.";
PA_LOG(VERBOSE) << "Creating ProximityAuthSystem.";
proximity_auth_system_.reset(new proximity_auth::ProximityAuthSystem(
GetType() == TYPE_SIGNIN
? proximity_auth::ProximityAuthSystem::SIGN_IN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() {
!device_sync_client_->is_ready()) {
// OnEnrollmentFinished() or OnNewDevicesSynced() will call back on this
// method once |device_sync_client_| is ready.
PA_LOG(INFO) << "DeviceSyncClient is not ready yet, delaying "
"UseLoadedRemoteDevices().";
PA_LOG(VERBOSE) << "DeviceSyncClient is not ready yet, delaying "
"UseLoadedRemoteDevices().";
return;
}

Expand All @@ -169,7 +169,7 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() {
!is_in_valid_legacy_host_state) {
// OnFeatureStatesChanged() will call back on this method when feature state
// changes.
PA_LOG(INFO) << "Smart Lock is disabled; aborting.";
PA_LOG(VERBOSE) << "Smart Lock is disabled; aborting.";
SetProximityAuthDevices(GetAccountId(), cryptauth::RemoteDeviceRefList(),
base::nullopt /* local_device */);
return;
Expand Down Expand Up @@ -209,7 +209,7 @@ void EasyUnlockServiceRegular::LoadRemoteDevices() {
// 1. New devices were synced on the lock screen.
// 2. The service was initialized while the login screen is still up.
if (proximity_auth::ScreenlockBridge::Get()->IsLocked()) {
PA_LOG(INFO) << "Deferring device load until screen is unlocked.";
PA_LOG(VERBOSE) << "Deferring device load until screen is unlocked.";
deferring_device_load_ = true;
return;
}
Expand Down Expand Up @@ -391,7 +391,7 @@ void EasyUnlockServiceRegular::SetRemoteDevices(
std::string remote_devices_json;
JSONStringValueSerializer serializer(&remote_devices_json);
serializer.Serialize(devices);
PA_LOG(INFO) << "Setting RemoteDevices:\n " << remote_devices_json;
PA_LOG(VERBOSE) << "Setting RemoteDevices:\n " << remote_devices_json;

DictionaryPrefUpdate pairing_update(profile()->GetPrefs(),
prefs::kEasyUnlockPairing);
Expand Down Expand Up @@ -733,7 +733,7 @@ void EasyUnlockServiceRegular::OnScreenDidUnlock(
// user is signing in we need to load the remotes. Otherwise, the
// first time the user locks the screen the feature won't work.
if (deferring_device_load_) {
PA_LOG(INFO) << "Loading deferred devices after screen unlock.";
PA_LOG(VERBOSE) << "Loading deferred devices after screen unlock.";
deferring_device_load_ = false;
LoadRemoteDevices();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ std::vector<cryptauth::BeaconSeed> DeserializeBeaconSeeds(
beacon_seeds.push_back(beacon_seed);
}

PA_LOG(INFO) << "Deserialized " << beacon_seeds.size() << " BeaconSeeds.";
PA_LOG(VERBOSE) << "Deserialized " << beacon_seeds.size() << " BeaconSeeds.";
return beacon_seeds;
}

Expand Down Expand Up @@ -198,8 +198,8 @@ void EasyUnlockServiceSignin::WrapChallengeForUserAndDevice(
&device_public_key_base64);
for (const auto& device_data : it->second->devices) {
if (device_data.public_key == device_public_key_base64) {
PA_LOG(INFO) << "Wrapping challenge for " << account_id.Serialize()
<< "...";
PA_LOG(VERBOSE) << "Wrapping challenge for " << account_id.Serialize()
<< "...";
challenge_wrapper_.reset(new EasyUnlockChallengeWrapper(
device_data.challenge, channel_binding_data, account_id,
EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile())));
Expand Down Expand Up @@ -409,7 +409,7 @@ void EasyUnlockServiceSignin::OnFocusedUserChanged(
EasyUnlockScreenlockStateHandler::HardlockState hardlock_state;
if (GetPersistedHardlockState(&hardlock_state) &&
hardlock_state != EasyUnlockScreenlockStateHandler::NO_HARDLOCK) {
PA_LOG(INFO) << "Hardlock present, skipping remaining login flow.";
PA_LOG(VERBOSE) << "Hardlock present, skipping remaining login flow.";
return;
}

Expand Down Expand Up @@ -503,8 +503,8 @@ void EasyUnlockServiceSignin::OnUserDataLoaded(

std::vector<cryptauth::BeaconSeed> beacon_seeds;
if (!device.serialized_beacon_seeds.empty()) {
PA_LOG(INFO) << "Deserializing BeaconSeeds: "
<< device.serialized_beacon_seeds;
PA_LOG(VERBOSE) << "Deserializing BeaconSeeds: "
<< device.serialized_beacon_seeds;
beacon_seeds = DeserializeBeaconSeeds(device.serialized_beacon_seeds);
} else {
PA_LOG(WARNING) << "No BeaconSeeds were loaded.";
Expand All @@ -516,11 +516,11 @@ void EasyUnlockServiceSignin::OnUserDataLoaded(
0L /* last_update_time_millis */, software_features, beacon_seeds);

remote_devices.push_back(remote_device);
PA_LOG(INFO) << "Loaded Remote Device:\n"
<< " user id: " << remote_device.user_id << "\n"
<< " device id: "
<< cryptauth::RemoteDeviceRef::TruncateDeviceIdForLogs(
remote_device.GetDeviceId());
PA_LOG(VERBOSE) << "Loaded Remote Device:\n"
<< " user id: " << remote_device.user_id << "\n"
<< " device id: "
<< cryptauth::RemoteDeviceRef::TruncateDeviceIdForLogs(
remote_device.GetDeviceId());
}

// If |chromeos::features::kMultiDeviceApi| is enabled, both a remote device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void AndroidSmsAppHelperDelegateImpl::InstallAndLaunchAndroidSmsApp() {
extensions::util::GetInstalledPwaForUrl(
profile_, chromeos::android_sms::GetAndroidMessagesURL());
if (!android_sms_pwa) {
PA_LOG(INFO) << "No Messages app found. Installing it.";
PA_LOG(VERBOSE) << "No Messages app found. Installing it.";
InstallAndroidSmsApp(true /* launch_on_install */);
return;
}
Expand All @@ -85,7 +85,7 @@ void AndroidSmsAppHelperDelegateImpl::LaunchAndroidSmsApp() {
profile_, chromeos::android_sms::GetAndroidMessagesURL());
DCHECK(android_sms_pwa);

PA_LOG(INFO) << "Messages app Launching...";
PA_LOG(VERBOSE) << "Messages app Launching...";
AppLaunchParams params(
profile_, android_sms_pwa, extensions::LAUNCH_CONTAINER_WINDOW,
WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL);
Expand All @@ -106,7 +106,7 @@ void AndroidSmsAppHelperDelegateImpl::OnAppInstalled(
content_settings::ResourceIdentifier(),
std::make_unique<base::Value>(ContentSetting::CONTENT_SETTING_ALLOW));

PA_LOG(INFO) << "Messages app installed! URL: " << app_url;
PA_LOG(VERBOSE) << "Messages app installed! URL: " << app_url;
if (launch_on_install)
LaunchAndroidSmsApp();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void AndroidSmsPairingStateTrackerImpl::OnCookiesRetrieved(
bool was_previously_paired = was_paired_on_last_update_;
for (const auto& cookie : cookies) {
if (cookie.Name() == kMessagesPairStateCookieName) {
PA_LOG(INFO) << "Cookie says Messages paired: " << cookie.Value();
PA_LOG(VERBOSE) << "Cookie says Messages paired: " << cookie.Value();
was_paired_on_last_update_ = cookie.Value() == kPairedCookieValue;
if (was_previously_paired != was_paired_on_last_update_)
NotifyPairingStateChanged();
Expand Down
15 changes: 8 additions & 7 deletions chrome/browser/chromeos/tether/tether_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ TetherService::TetherService(

UMA_HISTOGRAM_BOOLEAN("InstantTethering.UserPreference.OnStartup",
IsEnabledByPreference());
PA_LOG(INFO) << "TetherService has started. Initial user preference value: "
<< IsEnabledByPreference();
PA_LOG(VERBOSE)
<< "TetherService has started. Initial user preference value: "
<< IsEnabledByPreference();

if (base::FeatureList::IsEnabled(chromeos::features::kMultiDeviceApi)) {
if (device_sync_client_->is_ready())
Expand Down Expand Up @@ -217,7 +218,7 @@ void TetherService::StartTetherIfPossible() {
if (tether_component_)
return;

PA_LOG(INFO) << "Starting up TetherComponent.";
PA_LOG(VERBOSE) << "Starting up TetherComponent.";
tether_component_ =
chromeos::tether::TetherComponentImpl::Factory::NewInstance(
cryptauth_service_, device_sync_client_, secure_channel_client_,
Expand All @@ -243,7 +244,7 @@ void TetherService::StopTetherIfNecessary() {
return;
}

PA_LOG(INFO) << "Shutting down TetherComponent.";
PA_LOG(VERBOSE) << "Shutting down TetherComponent.";

chromeos::tether::TetherComponent::ShutdownReason shutdown_reason;
switch (GetTetherFeatureState()) {
Expand Down Expand Up @@ -430,7 +431,7 @@ void TetherService::OnShutdownComplete() {
chromeos::tether::TetherComponent::Status::SHUT_DOWN);
tether_component_->RemoveObserver(this);
tether_component_.reset();
PA_LOG(INFO) << "TetherComponent was shut down.";
PA_LOG(VERBOSE) << "TetherComponent was shut down.";

// It is possible that the Tether TechnologyState was set to ENABLED while the
// previous TetherComponent instance was shutting down. If that was the case,
Expand Down Expand Up @@ -820,8 +821,8 @@ bool TetherService::HandleFeatureStateMetricIfUninitialized() {
void TetherService::LogUserPreferenceChanged(bool is_now_enabled) {
UMA_HISTOGRAM_BOOLEAN("InstantTethering.UserPreference.OnToggle",
is_now_enabled);
PA_LOG(INFO) << "Tether user preference changed. New value: "
<< is_now_enabled;
PA_LOG(VERBOSE) << "Tether user preference changed. New value: "
<< is_now_enabled;
}

void TetherService::SetTestDoubles(
Expand Down
29 changes: 15 additions & 14 deletions chrome/browser/ui/ash/network/tether_notification_presenter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ TetherNotificationPresenter::~TetherNotificationPresenter() = default;
void TetherNotificationPresenter::NotifyPotentialHotspotNearby(
cryptauth::RemoteDeviceRef remote_device,
int signal_strength) {
PA_LOG(INFO) << "Displaying \"potential hotspot nearby\" notification for "
<< "device with name \"" << remote_device.name() << "\". "
<< "Notification ID = " << kPotentialHotspotNotificationId;
PA_LOG(VERBOSE) << "Displaying \"potential hotspot nearby\" notification for "
<< "device with name \"" << remote_device.name() << "\". "
<< "Notification ID = " << kPotentialHotspotNotificationId;

hotspot_nearby_device_id_ =
std::make_unique<std::string>(remote_device.GetDeviceId());
Expand All @@ -148,9 +148,9 @@ void TetherNotificationPresenter::NotifyPotentialHotspotNearby(
}

void TetherNotificationPresenter::NotifyMultiplePotentialHotspotsNearby() {
PA_LOG(INFO) << "Displaying \"potential hotspot nearby\" notification for "
<< "multiple devices. Notification ID = "
<< kPotentialHotspotNotificationId;
PA_LOG(VERBOSE) << "Displaying \"potential hotspot nearby\" notification for "
<< "multiple devices. Notification ID = "
<< kPotentialHotspotNotificationId;

hotspot_nearby_device_id_.reset();

Expand Down Expand Up @@ -185,8 +185,8 @@ void TetherNotificationPresenter::RemovePotentialHotspotNotification() {
void TetherNotificationPresenter::NotifySetupRequired(
const std::string& device_name,
int signal_strength) {
PA_LOG(INFO) << "Displaying \"setup required\" notification. Notification "
<< "ID = " << kSetupRequiredNotificationId;
PA_LOG(VERBOSE) << "Displaying \"setup required\" notification. Notification "
<< "ID = " << kSetupRequiredNotificationId;

ShowNotification(CreateNotification(
kSetupRequiredNotificationId,
Expand All @@ -204,8 +204,8 @@ void TetherNotificationPresenter::RemoveSetupRequiredNotification() {

void TetherNotificationPresenter::NotifyConnectionToHostFailed() {
const std::string id = kActiveHostNotificationId;
PA_LOG(INFO) << "Displaying \"connection attempt failed\" notification. "
<< "Notification ID = " << id;
PA_LOG(VERBOSE) << "Displaying \"connection attempt failed\" notification. "
<< "Notification ID = " << id;

ShowNotification(message_center::Notification::CreateSystemNotification(
message_center::NotificationType::NOTIFICATION_TYPE_SIMPLE, id,
Expand Down Expand Up @@ -240,8 +240,8 @@ void TetherNotificationPresenter::OnNotificationClicked(
"InstantTethering.NotificationInteractionType",
TetherNotificationPresenter::NOTIFICATION_BUTTON_TAPPED_HOST_NEARBY,
TetherNotificationPresenter::NOTIFICATION_INTERACTION_TYPE_MAX);
PA_LOG(INFO) << "\"Potential hotspot nearby\" notification button was "
<< "clicked.";
PA_LOG(VERBOSE) << "\"Potential hotspot nearby\" notification button was "
<< "clicked.";
network_connect_->ConnectToNetworkId(*hotspot_nearby_device_id_);
RemoveNotificationIfVisible(kPotentialHotspotNotificationId);
return;
Expand Down Expand Up @@ -326,8 +326,9 @@ void TetherNotificationPresenter::ShowNotification(
void TetherNotificationPresenter::OpenSettingsAndRemoveNotification(
const std::string& settings_subpage,
const std::string& notification_id) {
PA_LOG(INFO) << "Notification with ID " << notification_id << " was clicked. "
<< "Opening settings subpage: " << settings_subpage;
PA_LOG(VERBOSE) << "Notification with ID " << notification_id
<< " was clicked. "
<< "Opening settings subpage: " << settings_subpage;

settings_ui_delegate_->ShowSettingsSubPageForProfile(profile_,
settings_subpage);
Expand Down
Loading

0 comments on commit 8c73296

Please sign in to comment.