diff --git a/DEPS b/DEPS index b0b55ee9fc45..47e7bcc536fb 100644 --- a/DEPS +++ b/DEPS @@ -11,7 +11,7 @@ deps = { "vendor/python-patch": "https://github.com/svn2github/python-patch@a336a458016ced89aba90dfc3f4c8222ae3b1403", "vendor/omaha": "https://github.com/brave/omaha.git@5c633e867efafb9013c57ca830212d1ff6ea5076", "vendor/sparkle": "https://github.com/brave/Sparkle.git@c0759cce415d7c0feae45005c8a013b1898711f0", - "vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@6c198464110bfb3e1969067807ce0794fef110af", + "vendor/bat-native-ledger": "https://github.com/brave-intl/bat-native-ledger@a8550e6bf36eba0d62b3f24409d1cf4edb20827b", "vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e", "vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@9b119931c702d55be994117eb505d56310720b1d", "vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@adeff3254bb90ccdc9699040d5a4e1cd6b8393b7", diff --git a/components/brave_rewards/browser/publisher_info_database.cc b/components/brave_rewards/browser/publisher_info_database.cc index 4ba6c70950db..4d138591094c 100644 --- a/components/brave_rewards/browser/publisher_info_database.cc +++ b/components/brave_rewards/browser/publisher_info_database.cc @@ -761,7 +761,6 @@ sql::InitStatus PublisherInfoDatabase::EnsureCurrentVersion() { // Migration from version 1 to version 2 if (old_version == 1 && cur_version == 2) { - LOG(ERROR) << "I am in DB!"; if (!MigrateV1toV2()) { LOG(ERROR) << "DB: Error with MigrateV1toV2"; } diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 2a614c59ed28..bd4be5ed838d 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -281,13 +281,6 @@ RewardsServiceImpl::RewardsServiceImpl(Profile* profile) ledger::reconcile_time = defined_reconcile_int; } } - - // Verbose mode - #if defined(NDEBUG) - ledger::is_verbose = false; - #else - ledger::is_verbose = true; - #endif } RewardsServiceImpl::~RewardsServiceImpl() { @@ -489,7 +482,7 @@ void RewardsServiceImpl::RestorePublishers() { void RewardsServiceImpl::OnMediaPublisherInfoSaved(bool success) { if (!success) { - VLOG(1) << "Error in OnMediaPublisherInfoSaved"; + LOG(ERROR) << "Error in OnMediaPublisherInfoSaved"; } } @@ -807,7 +800,7 @@ std::unique_ptr RewardsServiceImpl::LoadURL( if (!content.empty()) fetcher->SetUploadData(contentType, content); - if (VLOG_IS_ON(2)) { + if (VLOG_IS_ON(ledger::LogLevel::REQUEST)) { std::string printMethod; switch (method) { case ledger::URL_METHOD::POST: @@ -820,15 +813,15 @@ std::unique_ptr RewardsServiceImpl::LoadURL( printMethod = "GET"; break; } - VLOG(2) << "[ REQUEST ]"; - VLOG(2) << "> url: " << url; - VLOG(2) << "> method: " << printMethod; - VLOG(2) << "> content: " << content; - VLOG(2) << "> contentType: " << contentType; + VLOG(ledger::LogLevel::REQUEST) << "[ REQUEST ]"; + VLOG(ledger::LogLevel::REQUEST) << "> url: " << url; + VLOG(ledger::LogLevel::REQUEST) << "> method: " << printMethod; + VLOG(ledger::LogLevel::REQUEST) << "> content: " << content; + VLOG(ledger::LogLevel::REQUEST) << "> contentType: " << contentType; for (size_t i = 0; i < headers.size(); i++) { - VLOG(2) << "> headers: " << headers[i]; + VLOG(ledger::LogLevel::REQUEST) << "> headers: " << headers[i]; } - VLOG(2) << "[ END REQUEST ]"; + VLOG(ledger::LogLevel::REQUEST) << "[ END REQUEST ]"; } FetchCallback callback = base::Bind( @@ -1319,7 +1312,7 @@ void RewardsServiceImpl::FetchFavIcon(const std::string& url, std::vector::iterator it; it = find (current_media_fetchers_.begin(), current_media_fetchers_.end(), url); if (it != current_media_fetchers_.end()) { - VLOG(1) << "Already fetching favicon: " << url; + LOG(ledger::LogLevel::WARNING) << "Already fetching favicon: " << url; return; } @@ -1605,4 +1598,23 @@ void RewardsServiceImpl::SetContributionAutoInclude(std::string publisher_key, windowId); } +void RewardsServiceImpl::Log(ledger::LogLevel level, const std::string& text) { + if (level == ledger::LogLevel::ERROR) { + LOG(ERROR) << text; + return; + } + + if (level == ledger::LogLevel::WARNING) { + LOG(WARNING) << text; + return; + } + + if (level == ledger::LogLevel::INFO) { + LOG(INFO) << text; + return; + } + + VLOG(level) << text; +} + } // namespace brave_rewards diff --git a/components/brave_rewards/browser/rewards_service_impl.h b/components/brave_rewards/browser/rewards_service_impl.h index 4000ebcd5cf5..5004872f35e2 100644 --- a/components/brave_rewards/browser/rewards_service_impl.h +++ b/components/brave_rewards/browser/rewards_service_impl.h @@ -248,6 +248,7 @@ class RewardsServiceImpl : public RewardsService, const std::string& publisher_key, const ledger::PUBLISHER_CATEGORY category) override; void GetRecurringDonations(ledger::RecurringDonationCallback callback) override; + void Log(ledger::LogLevel level, const std::string& text) override; void OnIOTaskComplete(std::function callback);