Commit 9ba291e3 authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

[NTP] Convert NTP service DLOGs into DVLOGs

Some of the NTP DLOGs trigger quite often, and none of them are
very useful to see on every NTP load. Convert them all to DVLOG(1)
so as not to spam the output, they can still be triggered with --v=1.

Bug: 929875
Change-Id: Ie1fb98a357c23a4ba67c6b105b0d640f372fbb65
Reviewed-on: https://chromium-review.googlesource.com/c/1460107Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630141}
parent a5ba6f9b
...@@ -150,8 +150,7 @@ void NtpBackgroundService::OnCollectionInfoFetchComplete( ...@@ -150,8 +150,7 @@ void NtpBackgroundService::OnCollectionInfoFetchComplete(
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " DVLOG(1) << "Request failed with error: " << loader_deleter->NetError();
<< loader_deleter->NetError();
collection_error_info_.error_type = ErrorType::NET_ERROR; collection_error_info_.error_type = ErrorType::NET_ERROR;
collection_error_info_.net_error = loader_deleter->NetError(); collection_error_info_.net_error = loader_deleter->NetError();
NotifyObservers(FetchComplete::COLLECTION_INFO); NotifyObservers(FetchComplete::COLLECTION_INFO);
...@@ -160,9 +159,8 @@ void NtpBackgroundService::OnCollectionInfoFetchComplete( ...@@ -160,9 +159,8 @@ void NtpBackgroundService::OnCollectionInfoFetchComplete(
ntp::background::GetCollectionsResponse collections_response; ntp::background::GetCollectionsResponse collections_response;
if (!collections_response.ParseFromString(*response_body)) { if (!collections_response.ParseFromString(*response_body)) {
DLOG(WARNING) DVLOG(1) << "Deserializing Backdrop wallpaper proto for collection info "
<< "Deserializing Backdrop wallpaper proto for collection info " "failed.";
"failed.";
collection_error_info_.error_type = ErrorType::SERVICE_ERROR; collection_error_info_.error_type = ErrorType::SERVICE_ERROR;
NotifyObservers(FetchComplete::COLLECTION_INFO); NotifyObservers(FetchComplete::COLLECTION_INFO);
return; return;
...@@ -246,8 +244,7 @@ void NtpBackgroundService::OnCollectionImageInfoFetchComplete( ...@@ -246,8 +244,7 @@ void NtpBackgroundService::OnCollectionImageInfoFetchComplete(
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " DVLOG(1) << "Request failed with error: " << loader_deleter->NetError();
<< loader_deleter->NetError();
collection_images_error_info_.error_type = ErrorType::NET_ERROR; collection_images_error_info_.error_type = ErrorType::NET_ERROR;
collection_images_error_info_.net_error = loader_deleter->NetError(); collection_images_error_info_.net_error = loader_deleter->NetError();
NotifyObservers(FetchComplete::COLLECTION_IMAGE_INFO); NotifyObservers(FetchComplete::COLLECTION_IMAGE_INFO);
...@@ -256,8 +253,7 @@ void NtpBackgroundService::OnCollectionImageInfoFetchComplete( ...@@ -256,8 +253,7 @@ void NtpBackgroundService::OnCollectionImageInfoFetchComplete(
ntp::background::GetImagesInCollectionResponse images_response; ntp::background::GetImagesInCollectionResponse images_response;
if (!images_response.ParseFromString(*response_body)) { if (!images_response.ParseFromString(*response_body)) {
DLOG(WARNING) DVLOG(1) << "Deserializing Backdrop wallpaper proto for image info failed.";
<< "Deserializing Backdrop wallpaper proto for image info failed.";
collection_images_error_info_.error_type = ErrorType::SERVICE_ERROR; collection_images_error_info_.error_type = ErrorType::SERVICE_ERROR;
NotifyObservers(FetchComplete::COLLECTION_IMAGE_INFO); NotifyObservers(FetchComplete::COLLECTION_IMAGE_INFO);
return; return;
...@@ -295,8 +291,7 @@ void NtpBackgroundService::GetAccessTokenForAlbumCallback( ...@@ -295,8 +291,7 @@ void NtpBackgroundService::GetAccessTokenForAlbumCallback(
token_fetcher_.reset(); token_fetcher_.reset();
if (error != GoogleServiceAuthError::AuthErrorNone()) { if (error != GoogleServiceAuthError::AuthErrorNone()) {
DLOG(WARNING) << "Failed to retrieve token with error: " DVLOG(1) << "Failed to retrieve token with error: " << error.ToString();
<< error.ToString();
if (error.state() == if (error.state() ==
GoogleServiceAuthError::State::INVALID_GAIA_CREDENTIALS) { GoogleServiceAuthError::State::INVALID_GAIA_CREDENTIALS) {
album_error_info_.error_type = ErrorType::AUTH_ERROR; album_error_info_.error_type = ErrorType::AUTH_ERROR;
...@@ -363,8 +358,7 @@ void NtpBackgroundService::OnAlbumInfoFetchComplete( ...@@ -363,8 +358,7 @@ void NtpBackgroundService::OnAlbumInfoFetchComplete(
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " DVLOG(1) << "Request failed with error: " << loader_deleter->NetError();
<< loader_deleter->NetError();
album_error_info_.error_type = ErrorType::NET_ERROR; album_error_info_.error_type = ErrorType::NET_ERROR;
album_error_info_.net_error = loader_deleter->NetError(); album_error_info_.net_error = loader_deleter->NetError();
NotifyObservers(FetchComplete::ALBUM_INFO); NotifyObservers(FetchComplete::ALBUM_INFO);
...@@ -374,7 +368,7 @@ void NtpBackgroundService::OnAlbumInfoFetchComplete( ...@@ -374,7 +368,7 @@ void NtpBackgroundService::OnAlbumInfoFetchComplete(
ntp::background::PersonalAlbumsResponse albums_response; ntp::background::PersonalAlbumsResponse albums_response;
if (!albums_response.ParseFromString(*response_body) || if (!albums_response.ParseFromString(*response_body) ||
albums_response.error_on_server()) { albums_response.error_on_server()) {
DLOG(WARNING) << "Deserializing personal albums response proto failed."; DVLOG(1) << "Deserializing personal albums response proto failed.";
album_error_info_.error_type = ErrorType::SERVICE_ERROR; album_error_info_.error_type = ErrorType::SERVICE_ERROR;
NotifyObservers(FetchComplete::ALBUM_INFO); NotifyObservers(FetchComplete::ALBUM_INFO);
return; return;
...@@ -416,8 +410,7 @@ void NtpBackgroundService::GetAccessTokenForPhotosCallback( ...@@ -416,8 +410,7 @@ void NtpBackgroundService::GetAccessTokenForPhotosCallback(
token_fetcher_.reset(); token_fetcher_.reset();
if (error != GoogleServiceAuthError::AuthErrorNone()) { if (error != GoogleServiceAuthError::AuthErrorNone()) {
DLOG(WARNING) << "Failed to retrieve token with error: " DVLOG(1) << "Failed to retrieve token with error: " << error.ToString();
<< error.ToString();
album_photos_error_info_.error_type = ErrorType::AUTH_ERROR; album_photos_error_info_.error_type = ErrorType::AUTH_ERROR;
NotifyObservers(FetchComplete::ALBUM_PHOTOS); NotifyObservers(FetchComplete::ALBUM_PHOTOS);
return; return;
...@@ -479,8 +472,7 @@ void NtpBackgroundService::OnAlbumPhotosFetchComplete( ...@@ -479,8 +472,7 @@ void NtpBackgroundService::OnAlbumPhotosFetchComplete(
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " DVLOG(1) << "Request failed with error: " << loader_deleter->NetError();
<< loader_deleter->NetError();
album_photos_error_info_.error_type = ErrorType::NET_ERROR; album_photos_error_info_.error_type = ErrorType::NET_ERROR;
album_photos_error_info_.net_error = loader_deleter->NetError(); album_photos_error_info_.net_error = loader_deleter->NetError();
NotifyObservers(FetchComplete::ALBUM_PHOTOS); NotifyObservers(FetchComplete::ALBUM_PHOTOS);
...@@ -490,7 +482,7 @@ void NtpBackgroundService::OnAlbumPhotosFetchComplete( ...@@ -490,7 +482,7 @@ void NtpBackgroundService::OnAlbumPhotosFetchComplete(
ntp::background::SettingPreviewResponse photos_response; ntp::background::SettingPreviewResponse photos_response;
if (!photos_response.ParseFromString(*response_body) || if (!photos_response.ParseFromString(*response_body) ||
photos_response.status() == ntp::background::ErrorCode::SERVER_ERROR) { photos_response.status() == ntp::background::ErrorCode::SERVER_ERROR) {
DLOG(WARNING) << "Deserializing personal photos response proto failed."; DVLOG(1) << "Deserializing personal photos response proto failed.";
album_photos_error_info_.error_type = ErrorType::SERVICE_ERROR; album_photos_error_info_.error_type = ErrorType::SERVICE_ERROR;
NotifyObservers(FetchComplete::ALBUM_PHOTOS); NotifyObservers(FetchComplete::ALBUM_PHOTOS);
return; return;
......
...@@ -89,32 +89,32 @@ bool GetStyleSheet(const base::DictionaryValue& dict, ...@@ -89,32 +89,32 @@ bool GetStyleSheet(const base::DictionaryValue& dict,
base::Optional<OneGoogleBarData> JsonToOGBData(const base::Value& value) { base::Optional<OneGoogleBarData> JsonToOGBData(const base::Value& value) {
const base::DictionaryValue* dict = nullptr; const base::DictionaryValue* dict = nullptr;
if (!value.GetAsDictionary(&dict)) { if (!value.GetAsDictionary(&dict)) {
DLOG(WARNING) << "Parse error: top-level dictionary not found"; DVLOG(1) << "Parse error: top-level dictionary not found";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* update = nullptr; const base::DictionaryValue* update = nullptr;
if (!dict->GetDictionary("update", &update)) { if (!dict->GetDictionary("update", &update)) {
DLOG(WARNING) << "Parse error: no update"; DVLOG(1) << "Parse error: no update";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* one_google_bar = nullptr; const base::DictionaryValue* one_google_bar = nullptr;
if (!update->GetDictionary("ogb", &one_google_bar)) { if (!update->GetDictionary("ogb", &one_google_bar)) {
DLOG(WARNING) << "Parse error: no ogb"; DVLOG(1) << "Parse error: no ogb";
return base::nullopt; return base::nullopt;
} }
OneGoogleBarData result; OneGoogleBarData result;
if (!safe_html::GetHtml(*one_google_bar, "html", &result.bar_html)) { if (!safe_html::GetHtml(*one_google_bar, "html", &result.bar_html)) {
DLOG(WARNING) << "Parse error: no html"; DVLOG(1) << "Parse error: no html";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* page_hooks = nullptr; const base::DictionaryValue* page_hooks = nullptr;
if (!one_google_bar->GetDictionary("page_hooks", &page_hooks)) { if (!one_google_bar->GetDictionary("page_hooks", &page_hooks)) {
DLOG(WARNING) << "Parse error: no page_hooks"; DVLOG(1) << "Parse error: no page_hooks";
return base::nullopt; return base::nullopt;
} }
...@@ -312,7 +312,7 @@ void OneGoogleBarLoaderImpl::LoadDone( ...@@ -312,7 +312,7 @@ void OneGoogleBarLoaderImpl::LoadDone(
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " << simple_loader->NetError(); DVLOG(1) << "Request failed with error: " << simple_loader->NetError();
Respond(Status::TRANSIENT_ERROR, base::nullopt); Respond(Status::TRANSIENT_ERROR, base::nullopt);
return; return;
} }
...@@ -341,7 +341,7 @@ void OneGoogleBarLoaderImpl::JsonParsed(std::unique_ptr<base::Value> value) { ...@@ -341,7 +341,7 @@ void OneGoogleBarLoaderImpl::JsonParsed(std::unique_ptr<base::Value> value) {
} }
void OneGoogleBarLoaderImpl::JsonParseFailed(const std::string& message) { void OneGoogleBarLoaderImpl::JsonParseFailed(const std::string& message) {
DLOG(WARNING) << "Parsing JSON failed: " << message; DVLOG(1) << "Parsing JSON failed: " << message;
Respond(Status::FATAL_ERROR, base::nullopt); Respond(Status::FATAL_ERROR, base::nullopt);
} }
......
...@@ -32,25 +32,25 @@ base::Optional<PromoData> JsonToPromoData(const base::Value& value, ...@@ -32,25 +32,25 @@ base::Optional<PromoData> JsonToPromoData(const base::Value& value,
const GURL& base_url) { const GURL& base_url) {
const base::DictionaryValue* dict = nullptr; const base::DictionaryValue* dict = nullptr;
if (!value.GetAsDictionary(&dict)) { if (!value.GetAsDictionary(&dict)) {
DLOG(WARNING) << "Parse error: top-level dictionary not found"; DVLOG(1) << "Parse error: top-level dictionary not found";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* update = nullptr; const base::DictionaryValue* update = nullptr;
if (!dict->GetDictionary("update", &update)) { if (!dict->GetDictionary("update", &update)) {
DLOG(WARNING) << "Parse error: no update"; DVLOG(1) << "Parse error: no update";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* promos = nullptr; const base::DictionaryValue* promos = nullptr;
if (!update->GetDictionary("promos", &promos)) { if (!update->GetDictionary("promos", &promos)) {
DLOG(WARNING) << "Parse error: no promos"; DVLOG(1) << "Parse error: no promos";
return base::nullopt; return base::nullopt;
} }
std::string middle = std::string(); std::string middle = std::string();
if (!promos->GetString("middle", &middle)) { if (!promos->GetString("middle", &middle)) {
DLOG(WARNING) << "No middle promo"; DVLOG(1) << "No middle promo";
return base::nullopt; return base::nullopt;
} }
...@@ -59,7 +59,7 @@ base::Optional<PromoData> JsonToPromoData(const base::Value& value, ...@@ -59,7 +59,7 @@ base::Optional<PromoData> JsonToPromoData(const base::Value& value,
std::string log_url = std::string(); std::string log_url = std::string();
if (!promos->GetString("log_url", &log_url)) { if (!promos->GetString("log_url", &log_url)) {
DLOG(WARNING) << "No promo log_url"; DVLOG(1) << "No promo log_url";
return base::nullopt; return base::nullopt;
} }
...@@ -136,8 +136,7 @@ void PromoService::OnLoadDone(std::unique_ptr<std::string> response_body) { ...@@ -136,8 +136,7 @@ void PromoService::OnLoadDone(std::unique_ptr<std::string> response_body) {
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " DVLOG(1) << "Request failed with error: " << simple_loader_->NetError();
<< simple_loader_->NetError();
PromoDataLoaded(Status::TRANSIENT_ERROR, base::nullopt); PromoDataLoaded(Status::TRANSIENT_ERROR, base::nullopt);
return; return;
} }
...@@ -168,7 +167,7 @@ void PromoService::OnJsonParsed(std::unique_ptr<base::Value> value) { ...@@ -168,7 +167,7 @@ void PromoService::OnJsonParsed(std::unique_ptr<base::Value> value) {
} }
void PromoService::OnJsonParseFailed(const std::string& message) { void PromoService::OnJsonParseFailed(const std::string& message) {
DLOG(WARNING) << "Parsing JSON failed: " << message; DVLOG(1) << "Parsing JSON failed: " << message;
PromoDataLoaded(Status::FATAL_ERROR, base::nullopt); PromoDataLoaded(Status::FATAL_ERROR, base::nullopt);
} }
......
...@@ -41,19 +41,19 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData( ...@@ -41,19 +41,19 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData(
const base::Value& value) { const base::Value& value) {
const base::DictionaryValue* dict = nullptr; const base::DictionaryValue* dict = nullptr;
if (!value.GetAsDictionary(&dict)) { if (!value.GetAsDictionary(&dict)) {
DLOG(WARNING) << "Parse error: top-level dictionary not found"; DVLOG(1) << "Parse error: top-level dictionary not found";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* update = nullptr; const base::DictionaryValue* update = nullptr;
if (!dict->GetDictionary("update", &update)) { if (!dict->GetDictionary("update", &update)) {
DLOG(WARNING) << "Parse error: no update"; DVLOG(1) << "Parse error: no update";
return base::nullopt; return base::nullopt;
} }
const base::DictionaryValue* query_suggestions = nullptr; const base::DictionaryValue* query_suggestions = nullptr;
if (!update->GetDictionary("query_suggestions", &query_suggestions)) { if (!update->GetDictionary("query_suggestions", &query_suggestions)) {
DLOG(WARNING) << "Parse error: no query_suggestions"; DVLOG(1) << "Parse error: no query_suggestions";
return base::nullopt; return base::nullopt;
} }
...@@ -61,7 +61,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData( ...@@ -61,7 +61,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData(
std::string suggestions_html = std::string(); std::string suggestions_html = std::string();
if (!query_suggestions->GetString("query_suggestions_with_html", if (!query_suggestions->GetString("query_suggestions_with_html",
&suggestions_html)) { &suggestions_html)) {
DLOG(WARNING) << "Parse error: no query_suggestions_with_html"; DVLOG(1) << "Parse error: no query_suggestions_with_html";
return base::nullopt; return base::nullopt;
} }
...@@ -70,7 +70,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData( ...@@ -70,7 +70,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData(
std::string end_of_body_script = std::string(); std::string end_of_body_script = std::string();
if (!query_suggestions->GetString("script", &end_of_body_script)) { if (!query_suggestions->GetString("script", &end_of_body_script)) {
DLOG(WARNING) << "Parse error: no script"; DVLOG(1) << "Parse error: no script";
return base::nullopt; return base::nullopt;
} }
...@@ -79,7 +79,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData( ...@@ -79,7 +79,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData(
int impression_cap_expire_time_ms; int impression_cap_expire_time_ms;
if (!query_suggestions->GetInteger("impression_cap_expire_time_ms", if (!query_suggestions->GetInteger("impression_cap_expire_time_ms",
&impression_cap_expire_time_ms)) { &impression_cap_expire_time_ms)) {
DLOG(WARNING) << "Parse error: no impression_cap_expire_time_ms"; DVLOG(1) << "Parse error: no impression_cap_expire_time_ms";
return base::nullopt; return base::nullopt;
} }
...@@ -88,7 +88,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData( ...@@ -88,7 +88,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData(
int request_freeze_time_ms; int request_freeze_time_ms;
if (!query_suggestions->GetInteger("request_freeze_time_ms", if (!query_suggestions->GetInteger("request_freeze_time_ms",
&request_freeze_time_ms)) { &request_freeze_time_ms)) {
DLOG(WARNING) << "Parse error: no request_freeze_time_ms"; DVLOG(1) << "Parse error: no request_freeze_time_ms";
return base::nullopt; return base::nullopt;
} }
...@@ -96,7 +96,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData( ...@@ -96,7 +96,7 @@ base::Optional<SearchSuggestData> JsonToSearchSuggestionData(
int max_impressions; int max_impressions;
if (!query_suggestions->GetInteger("max_impressions", &max_impressions)) { if (!query_suggestions->GetInteger("max_impressions", &max_impressions)) {
DLOG(WARNING) << "Parse error: no max_impressions"; DVLOG(1) << "Parse error: no max_impressions";
return base::nullopt; return base::nullopt;
} }
...@@ -244,7 +244,7 @@ void SearchSuggestLoaderImpl::LoadDone( ...@@ -244,7 +244,7 @@ void SearchSuggestLoaderImpl::LoadDone(
if (!response_body) { if (!response_body) {
// This represents network errors (i.e. the server did not provide a // This represents network errors (i.e. the server did not provide a
// response). // response).
DLOG(WARNING) << "Request failed with error: " << simple_loader->NetError(); DVLOG(1) << "Request failed with error: " << simple_loader->NetError();
Respond(Status::TRANSIENT_ERROR, base::nullopt); Respond(Status::TRANSIENT_ERROR, base::nullopt);
return; return;
} }
...@@ -273,7 +273,7 @@ void SearchSuggestLoaderImpl::JsonParsed(std::unique_ptr<base::Value> value) { ...@@ -273,7 +273,7 @@ void SearchSuggestLoaderImpl::JsonParsed(std::unique_ptr<base::Value> value) {
} }
void SearchSuggestLoaderImpl::JsonParseFailed(const std::string& message) { void SearchSuggestLoaderImpl::JsonParseFailed(const std::string& message) {
DLOG(WARNING) << "Parsing JSON failed: " << message; DVLOG(1) << "Parsing JSON failed: " << message;
Respond(Status::FATAL_ERROR, base::nullopt); Respond(Status::FATAL_ERROR, base::nullopt);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment