From 4ecb67c83ca9f3ed80c2ca86135f0a6b8b53e489 Mon Sep 17 00:00:00 2001 From: brave-builds Date: Wed, 5 May 2021 18:54:20 +0000 Subject: [PATCH] Uplift of #8598 (squashed) to beta --- chromium_src/chrome/browser/about_flags.cc | 4 ++++ .../chrome/browser/flag_descriptions.cc | 8 ++++++++ .../chrome/browser/flag_descriptions.h | 2 ++ .../browser/rewards_service_impl.cc | 20 +++++++++---------- .../browser/rewards_service_impl.h | 2 +- components/brave_rewards/common/features.cc | 3 +++ components/brave_rewards/common/features.h | 1 + .../internal/account/ad_rewards/ad_rewards.cc | 6 ++++-- .../api/get_parameters/get_parameters.cc | 1 + .../get_balance/get_balance_bitflyer.cc | 2 ++ .../post_oauth/post_oauth_bitflyer.cc | 2 ++ .../post_transaction_bitflyer.cc | 2 ++ .../get_credentials/get_credentials.cc | 1 + .../post_credentials/post_credentials.cc | 1 + .../endpoint/payment/post_order/post_order.cc | 1 + .../post_transaction_anon.cc | 1 + .../post_transaction_uphold.cc | 1 + .../endpoint/payment/post_votes/post_votes.cc | 1 + .../get_publisher/get_publisher.cc | 1 + .../promotion/get_available/get_available.cc | 1 + .../promotion/get_captcha/get_captcha.cc | 1 + .../endpoint/promotion/get_drain/get_drain.cc | 1 + .../get_recover_wallet/get_recover_wallet.cc | 1 + .../get_signed_creds/get_signed_creds.cc | 1 + .../get_wallet_balance/get_wallet_balance.cc | 1 + .../promotion/post_bat_loss/post_bat_loss.cc | 1 + .../promotion/post_captcha/post_captcha.cc | 1 + .../post_claim_bitflyer.cc | 1 + .../post_claim_brave/post_claim_brave.cc | 1 + .../post_claim_uphold/post_claim_uphold.cc | 1 + .../post_clobbered_claims.cc | 1 + .../promotion/post_creds/post_creds.cc | 1 + .../post_devicecheck/post_devicecheck.cc | 1 + .../post_safetynet/post_safetynet.cc | 1 + .../post_suggestions/post_suggestions.cc | 1 + .../post_suggestions_claim.cc | 1 + .../post_wallet_brave/post_wallet_brave.cc | 1 + .../promotion/put_captcha/put_captcha.cc | 1 + .../put_devicecheck/put_devicecheck.cc | 1 + .../promotion/put_safetynet/put_safetynet.cc | 1 + .../get_prefix_list/get_prefix_list.cc | 1 + .../endpoint/uphold/get_card/get_card.cc | 2 ++ .../endpoint/uphold/get_cards/get_cards.cc | 2 ++ .../internal/endpoint/uphold/get_me/get_me.cc | 2 ++ .../endpoint/uphold/patch_card/patch_card.cc | 2 ++ .../endpoint/uphold/post_cards/post_cards.cc | 2 ++ .../endpoint/uphold/post_oauth/post_oauth.cc | 2 ++ .../post_transaction/post_transaction.cc | 2 ++ .../post_transaction_commit.cc | 2 ++ .../bat/ledger/internal/legacy/bat_state.cc | 3 ++- 50 files changed, 87 insertions(+), 14 deletions(-) diff --git a/chromium_src/chrome/browser/about_flags.cc b/chromium_src/chrome/browser/about_flags.cc index 92654a5d5ab4..563451552350 100644 --- a/chromium_src/chrome/browser/about_flags.cc +++ b/chromium_src/chrome/browser/about_flags.cc @@ -174,6 +174,10 @@ using ntp_background_images::features::kBraveNTPSuperReferralWallpaper; flag_descriptions::kBravePermissionLifetimeName, \ flag_descriptions::kBravePermissionLifetimeDescription, kOsAll, \ FEATURE_VALUE_TYPE(permissions::features::kPermissionLifetime)}, \ + {"brave-rewards-verbose-logging", \ + flag_descriptions::kBraveRewardsVerboseLoggingName, \ + flag_descriptions::kBraveRewardsVerboseLoggingDescription, kOsDesktop, \ + FEATURE_VALUE_TYPE(brave_rewards::features::kVerboseLoggingFeature)}, \ {"brave-rewards-bitflyer", \ flag_descriptions::kBraveRewardsBitflyerName, \ flag_descriptions::kBraveRewardsBitflyerDescription, kOsDesktop, \ diff --git a/chromium_src/chrome/browser/flag_descriptions.cc b/chromium_src/chrome/browser/flag_descriptions.cc index bcd7f74a56a8..854a8c00a5cd 100644 --- a/chromium_src/chrome/browser/flag_descriptions.cc +++ b/chromium_src/chrome/browser/flag_descriptions.cc @@ -57,6 +57,14 @@ const char kBraveSyncDescription[] = const char kBraveIpfsName[] = "Enable IPFS"; const char kBraveIpfsDescription[] = "Enable native support of IPFS."; +const char kBraveRewardsVerboseLoggingName[] = + "Enable Brave Rewards verbose logging"; +const char kBraveRewardsVerboseLoggingDescription[] = + "Enables detailed logging of Brave Rewards system events to a log file " + "stored on your device. Please note that this log file could include " + "information such as browsing history and credentials such as passwords " + "and access tokens depending on your activity. Please do not share it " + "unless asked to by Brave staff."; const char kBraveRewardsBitflyerName[] = "Enable bitFlyer for Brave Rewards"; const char kBraveRewardsBitflyerDescription[] = "Enables support for bitFlyer as an external wallet provider for Brave " diff --git a/chromium_src/chrome/browser/flag_descriptions.h b/chromium_src/chrome/browser/flag_descriptions.h index 0d5b67109c03..c9a8a3059e49 100644 --- a/chromium_src/chrome/browser/flag_descriptions.h +++ b/chromium_src/chrome/browser/flag_descriptions.h @@ -35,6 +35,8 @@ extern const char kBraveSyncName[]; extern const char kBraveSyncDescription[]; extern const char kBraveIpfsName[]; extern const char kBraveIpfsDescription[]; +extern const char kBraveRewardsVerboseLoggingName[]; +extern const char kBraveRewardsVerboseLoggingDescription[]; extern const char kBraveRewardsBitflyerName[]; extern const char kBraveRewardsBitflyerDescription[]; extern const char kNativeBraveWalletName[]; diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 71e4efa45151..0a6fe9df2f8f 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -334,6 +334,9 @@ RewardsServiceImpl::RewardsServiceImpl(Profile* profile) content::URLDataSource::Add(profile_, std::make_unique(profile_)); ready_ = std::make_unique(); + + if (base::FeatureList::IsEnabled(features::kVerboseLoggingFeature)) + persist_log_level_ = kDiagnosticLogMaxVerboseLevel; } RewardsServiceImpl::~RewardsServiceImpl() { @@ -2263,15 +2266,12 @@ void RewardsServiceImpl::WriteDiagnosticLog(const std::string& file, const int line, const int verbose_level, const std::string& message) { - if (ledger_for_testing_ || !should_persist_logs_) { - return; - } - - if (resetting_rewards_) { + if (ledger_for_testing_ || resetting_rewards_) { return; } - if (verbose_level > kDiagnosticLogMaxVerboseLevel) { + if (verbose_level > kDiagnosticLogMaxVerboseLevel || + verbose_level > persist_log_level_) { return; } @@ -2414,13 +2414,13 @@ void RewardsServiceImpl::HandleFlags(const std::string& options) { continue; } + // The "persist-logs" command-line flag is deprecated and will be removed + // in a future version. Use --enable-features=BraveRewardsVerboseLogging + // instead. if (name == "persist-logs") { const std::string lower = base::ToLowerASCII(value); - if (lower == "true" || lower == "1") { - should_persist_logs_ = true; - } else { - should_persist_logs_ = false; + persist_log_level_ = kDiagnosticLogMaxVerboseLevel; } } diff --git a/components/brave_rewards/browser/rewards_service_impl.h b/components/brave_rewards/browser/rewards_service_impl.h index 871d6823c3d6..049ae938876f 100644 --- a/components/brave_rewards/browser/rewards_service_impl.h +++ b/components/brave_rewards/browser/rewards_service_impl.h @@ -790,7 +790,7 @@ class RewardsServiceImpl : public RewardsService, bool reset_states_; bool ledger_for_testing_ = false; bool resetting_rewards_ = false; - bool should_persist_logs_ = false; + int persist_log_level_ = 0; GetTestResponseCallback test_response_callback_; diff --git a/components/brave_rewards/common/features.cc b/components/brave_rewards/common/features.cc index 07f5e1884e5e..3232fdda2643 100644 --- a/components/brave_rewards/common/features.cc +++ b/components/brave_rewards/common/features.cc @@ -13,5 +13,8 @@ namespace features { const base::Feature kBitflyerFeature{"BraveRewardsBitflyer", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kVerboseLoggingFeature{"BraveRewardsVerboseLogging", + base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace features } // namespace brave_rewards diff --git a/components/brave_rewards/common/features.h b/components/brave_rewards/common/features.h index 674c6f8e5025..8b131f3f4b39 100644 --- a/components/brave_rewards/common/features.h +++ b/components/brave_rewards/common/features.h @@ -14,6 +14,7 @@ namespace brave_rewards { namespace features { extern const base::Feature kBitflyerFeature; +extern const base::Feature kVerboseLoggingFeature; } // namespace features } // namespace brave_rewards diff --git a/vendor/bat-native-ads/src/bat/ads/internal/account/ad_rewards/ad_rewards.cc b/vendor/bat-native-ads/src/bat/ads/internal/account/ad_rewards/ad_rewards.cc index d0a91525fa3e..5b10692a8aa4 100644 --- a/vendor/bat-native-ads/src/bat/ads/internal/account/ad_rewards/ad_rewards.cc +++ b/vendor/bat-native-ads/src/bat/ads/internal/account/ad_rewards/ad_rewards.cc @@ -283,7 +283,8 @@ void AdRewards::OnGetPayments(const UrlResponse& url_response) { } if (!payments_->SetFromJson(url_response.body)) { - BLOG(0, "Failed to parse payment balance: " << url_response.body); + BLOG(0, "Failed to parse payment balance"); + BLOG(6, "Payment balance response body: " << url_response.body); OnFailedToReconcileAdRewards(); return; } @@ -324,7 +325,8 @@ void AdRewards::OnGetAdGrants(const UrlResponse& url_response) { } if (!ad_grants_->SetFromJson(url_response.body)) { - BLOG(0, "Failed to parse ad grants: " << url_response.body); + BLOG(0, "Failed to parse ad grants"); + BLOG(6, "Ad grants response body: " << url_response.body); OnFailedToReconcileAdRewards(); return; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/api/get_parameters/get_parameters.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/api/get_parameters/get_parameters.cc index f8bd474270fb..a544cebec5d4 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/api/get_parameters/get_parameters.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/api/get_parameters/get_parameters.cc @@ -50,6 +50,7 @@ type::Result GetParameters::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc index c10ab22256f4..728e1ad87642 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc @@ -34,10 +34,12 @@ type::Result GetBalance::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED || status_code == net::HTTP_NOT_FOUND || status_code == net::HTTP_FORBIDDEN) { + BLOG(0, "Invalid authorization HTTP status: " << status_code); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc index 3a75dd3b0e64..40c6f097f198 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc @@ -58,10 +58,12 @@ std::string PostOauth::GeneratePayload(const std::string& external_account_id, type::Result PostOauth::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.cc index edbe656dfb2a..4538e987884e 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/bitflyer/post_transaction/post_transaction_bitflyer.cc @@ -55,6 +55,7 @@ std::string PostTransaction::GeneratePayload( type::Result PostTransaction::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } @@ -64,6 +65,7 @@ type::Result PostTransaction::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/get_credentials/get_credentials.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/get_credentials/get_credentials.cc index 317b22dbac80..4d33e45bbce8 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/get_credentials/get_credentials.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/get_credentials/get_credentials.cc @@ -59,6 +59,7 @@ type::Result GetCredentials::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::RETRY; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_credentials/post_credentials.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_credentials/post_credentials.cc index fc5f009b09ab..8133a842a5ee 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_credentials/post_credentials.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_credentials/post_credentials.cc @@ -66,6 +66,7 @@ type::Result PostCredentials::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_order/post_order.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_order/post_order.cc index d1f24696e11e..06afe014f7e3 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_order/post_order.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_order/post_order.cc @@ -63,6 +63,7 @@ type::Result PostOrder::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_CREATED) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_anon/post_transaction_anon.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_anon/post_transaction_anon.cc index eb2ed7445fa8..ff96fc59b9a6 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_anon/post_transaction_anon.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_anon/post_transaction_anon.cc @@ -110,6 +110,7 @@ type::Result PostTransactionAnon::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_CREATED) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc index 7db71f184a90..fe679655d77d 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc @@ -69,6 +69,7 @@ type::Result PostTransactionUphold::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_CREATED) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_votes/post_votes.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_votes/post_votes.cc index f981db55618a..8e0748e17ef2 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_votes/post_votes.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/payment/post_votes/post_votes.cc @@ -75,6 +75,7 @@ type::Result PostVotes::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/private_cdn/get_publisher/get_publisher.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/private_cdn/get_publisher/get_publisher.cc index 5f83a548f0ab..544f45c8c521 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/private_cdn/get_publisher/get_publisher.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/private_cdn/get_publisher/get_publisher.cc @@ -163,6 +163,7 @@ type::Result GetPublisher::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_available/get_available.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_available/get_available.cc index 1da428f5e0ab..331f07eb5849 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_available/get_available.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_available/get_available.cc @@ -66,6 +66,7 @@ type::Result GetAvailable::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_captcha/get_captcha.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_captcha/get_captcha.cc index 1ac99f828efd..4665bcbeec35 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_captcha/get_captcha.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_captcha/get_captcha.cc @@ -50,6 +50,7 @@ type::Result GetCaptcha::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_drain/get_drain.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_drain/get_drain.cc index 43a0fc80f092..2ce69f3126c2 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_drain/get_drain.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_drain/get_drain.cc @@ -42,6 +42,7 @@ type::Result GetDrain::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_recover_wallet/get_recover_wallet.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_recover_wallet/get_recover_wallet.cc index af6b5c9db6c2..94907860bbf5 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_recover_wallet/get_recover_wallet.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_recover_wallet/get_recover_wallet.cc @@ -45,6 +45,7 @@ type::Result GetRecoverWallet::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_signed_creds/get_signed_creds.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_signed_creds/get_signed_creds.cc index f79fd787ecc6..555e5a1d156f 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_signed_creds/get_signed_creds.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_signed_creds/get_signed_creds.cc @@ -58,6 +58,7 @@ type::Result GetSignedCreds::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_wallet_balance/get_wallet_balance.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_wallet_balance/get_wallet_balance.cc index 973f0a6c0f55..f3a563dd3d02 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_wallet_balance/get_wallet_balance.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/get_wallet_balance/get_wallet_balance.cc @@ -57,6 +57,7 @@ type::Result GetWalletBalance::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_bat_loss/post_bat_loss.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_bat_loss/post_bat_loss.cc index 0a9637087fd3..d983369b8e89 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_bat_loss/post_bat_loss.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_bat_loss/post_bat_loss.cc @@ -51,6 +51,7 @@ type::Result PostBatLoss::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_captcha/post_captcha.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_captcha/post_captcha.cc index 48d8e9069442..4861c0c008a9 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_captcha/post_captcha.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_captcha/post_captcha.cc @@ -55,6 +55,7 @@ type::Result PostCaptcha::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_bitflyer/post_claim_bitflyer.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_bitflyer/post_claim_bitflyer.cc index cb4e8cabb2bb..a0d835dc304c 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_bitflyer/post_claim_bitflyer.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_bitflyer/post_claim_bitflyer.cc @@ -79,6 +79,7 @@ type::Result PostClaimBitflyer::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_brave/post_claim_brave.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_brave/post_claim_brave.cc index aa9763679581..bf9509c75d46 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_brave/post_claim_brave.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_brave/post_claim_brave.cc @@ -79,6 +79,7 @@ type::Result PostClaimBrave::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_uphold/post_claim_uphold.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_uphold/post_claim_uphold.cc index 89320562f886..7caad4ed116d 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_uphold/post_claim_uphold.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_claim_uphold/post_claim_uphold.cc @@ -129,6 +129,7 @@ type::Result PostClaimUphold::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_clobbered_claims/post_clobbered_claims.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_clobbered_claims/post_clobbered_claims.cc index b13b9767f014..532b443000e4 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_clobbered_claims/post_clobbered_claims.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_clobbered_claims/post_clobbered_claims.cc @@ -50,6 +50,7 @@ type::Result PostClobberedClaims::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_creds/post_creds.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_creds/post_creds.cc index 0094aff220de..58f55c96047c 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_creds/post_creds.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_creds/post_creds.cc @@ -80,6 +80,7 @@ type::Result PostCreds::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_devicecheck/post_devicecheck.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_devicecheck/post_devicecheck.cc index a31330bee1ed..4896390a8a70 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_devicecheck/post_devicecheck.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_devicecheck/post_devicecheck.cc @@ -58,6 +58,7 @@ type::Result PostDevicecheck::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_safetynet/post_safetynet.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_safetynet/post_safetynet.cc index c2fa13754957..c5294f6f52b4 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_safetynet/post_safetynet.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_safetynet/post_safetynet.cc @@ -61,6 +61,7 @@ type::Result PostSafetynet::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions/post_suggestions.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions/post_suggestions.cc index f88238e31310..f919b3d5a89a 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions/post_suggestions.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions/post_suggestions.cc @@ -79,6 +79,7 @@ type::Result PostSuggestions::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions_claim/post_suggestions_claim.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions_claim/post_suggestions_claim.cc index ff6dfcbe30e3..102054e4c285 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions_claim/post_suggestions_claim.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_suggestions_claim/post_suggestions_claim.cc @@ -66,6 +66,7 @@ type::Result PostSuggestionsClaim::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_wallet_brave/post_wallet_brave.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_wallet_brave/post_wallet_brave.cc index 6a68c7c5339a..13a052699494 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_wallet_brave/post_wallet_brave.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/post_wallet_brave/post_wallet_brave.cc @@ -43,6 +43,7 @@ type::Result PostWalletBrave::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_CREATED) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_captcha/put_captcha.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_captcha/put_captcha.cc index da4fb113cc3f..6c2c32fc0527 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_captcha/put_captcha.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_captcha/put_captcha.cc @@ -62,6 +62,7 @@ type::Result PutCaptcha::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_devicecheck/put_devicecheck.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_devicecheck/put_devicecheck.cc index dba00befa106..85441700281f 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_devicecheck/put_devicecheck.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_devicecheck/put_devicecheck.cc @@ -62,6 +62,7 @@ type::Result PutDevicecheck::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_safetynet/put_safetynet.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_safetynet/put_safetynet.cc index 5ecbdb6e7d28..48536b5b8bb0 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_safetynet/put_safetynet.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/promotion/put_safetynet/put_safetynet.cc @@ -59,6 +59,7 @@ type::Result PutSafetynet::CheckStatusCode(const int status_code) { } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc index c33f2a467612..75213c8e0e0b 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc @@ -30,6 +30,7 @@ std::string GetPrefixList::GetUrl() { type::Result GetPrefixList::CheckStatusCode(const int status_code) { if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_card/get_card.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_card/get_card.cc index 52d0cbfcd11e..bb033127eed4 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_card/get_card.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_card/get_card.cc @@ -36,10 +36,12 @@ type::Result GetCard::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED || status_code == net::HTTP_NOT_FOUND || status_code == net::HTTP_FORBIDDEN) { + BLOG(0, "Unauthorized access HTTP status: " << status_code); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_cards/get_cards.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_cards/get_cards.cc index 3f064c40f9c6..7c3ec2f2ce3c 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_cards/get_cards.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_cards/get_cards.cc @@ -33,10 +33,12 @@ std::string GetCards::GetUrl() { type::Result GetCards::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_me/get_me.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_me/get_me.cc index ef372acdd001..94c437ac1446 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_me/get_me.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/get_me/get_me.cc @@ -56,10 +56,12 @@ std::string GetMe::GetUrl() { type::Result GetMe::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/patch_card/patch_card.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/patch_card/patch_card.cc index f64e3dad016d..e9e169e8a085 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/patch_card/patch_card.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/patch_card/patch_card.cc @@ -52,10 +52,12 @@ std::string PatchCard::GeneratePayload( type::Result PatchCard::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_cards/post_cards.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_cards/post_cards.cc index 228334268920..724c07202986 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_cards/post_cards.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_cards/post_cards.cc @@ -43,10 +43,12 @@ std::string PostCards::GeneratePayload() { type::Result PostCards::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_oauth/post_oauth.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_oauth/post_oauth.cc index 37de6885fda8..24e915e78102 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_oauth/post_oauth.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_oauth/post_oauth.cc @@ -38,10 +38,12 @@ std::string PostOauth::GeneratePayload(const std::string& code) { type::Result PostOauth::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction/post_transaction.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction/post_transaction.cc index b52e59af8342..715165d687c0 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction/post_transaction.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction/post_transaction.cc @@ -55,10 +55,12 @@ std::string PostTransaction::GeneratePayload( type::Result PostTransaction::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_ACCEPTED) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction_commit/post_transaction_commit.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction_commit/post_transaction_commit.cc index 0fb19c7c47cb..4ce562617223 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction_commit/post_transaction_commit.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/endpoint/uphold/post_transaction_commit/post_transaction_commit.cc @@ -38,10 +38,12 @@ std::string PostTransactionCommit::GetUrl( type::Result PostTransactionCommit::CheckStatusCode(const int status_code) { if (status_code == net::HTTP_UNAUTHORIZED) { + BLOG(0, "Unauthorized access"); return type::Result::EXPIRED_TOKEN; } if (status_code != net::HTTP_OK) { + BLOG(0, "Unexpected HTTP status: " << status_code); return type::Result::LEDGER_ERROR; } diff --git a/vendor/bat-native-ledger/src/bat/ledger/internal/legacy/bat_state.cc b/vendor/bat-native-ledger/src/bat/ledger/internal/legacy/bat_state.cc index 14e97b72d56b..b45b4e2e8e61 100644 --- a/vendor/bat-native-ledger/src/bat/ledger/internal/legacy/bat_state.cc +++ b/vendor/bat-native-ledger/src/bat/ledger/internal/legacy/bat_state.cc @@ -45,7 +45,8 @@ void LegacyBatState::OnLoad( ledger::ClientProperties state; const ledger::ClientState client_state; if (!client_state.FromJson(data, &state)) { - BLOG(0, "Failed to load client state: " << data); + BLOG(0, "Failed to load client state"); + BLOG(6, "Client state contents: " << data); callback(ledger::type::Result::LEDGER_ERROR); return; }