Skip to content

Commit

Permalink
Merge pull request #75 from brave-intl/issues/52
Browse files Browse the repository at this point in the history
Add support for VLOG to help reduce noise in logs for INFO
  • Loading branch information
NejcZdovc authored Feb 25, 2019
2 parents 211e767 + a58a0c2 commit fc7de34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
3 changes: 3 additions & 0 deletions include/bat/confirmations/confirmations_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ using URLRequestMethod = ::ledger::URL_METHOD;
using Result = ::ledger::Result;
const auto SUCCESS = ::ledger::Result::LEDGER_OK;
const auto FAILED = ::ledger::Result::LEDGER_ERROR;
const auto INFO = ::ledger::LogLevel::LOG_INFO;
const auto WARNING = ::ledger::LogLevel::LOG_WARNING;
const auto ERROR = ::ledger::LogLevel::LOG_ERROR;

using OnSaveCallback = ::ledger::OnSaveCallback;
using OnLoadCallback = ::ledger::OnLoadCallback;
Expand Down
20 changes: 4 additions & 16 deletions src/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,10 @@

#include "bat/confirmations/confirmations_client.h"

#define CONFIRMATIONS_LOG_INFO \
confirmations_client_->Log( \
__FILE__, __LINE__, ::ledger::LogLevel::LOG_INFO)
#define BLOG(severity) \
confirmations_client_->Log(__FILE__, __LINE__, severity)->stream()

#define CONFIRMATIONS_LOG_WARNING \
confirmations_client_->Log( \
__FILE__, __LINE__, ::ledger::LogLevel::LOG_WARNING)

#define CONFIRMATIONS_LOG_ERROR \
confirmations_client_->Log( \
__FILE__, __LINE__, ::ledger::LogLevel::LOG_ERROR)

#define BLOG(severity) CONFIRMATIONS_LOG_ ## severity->stream()

#if defined(ERROR)
#define LOG_0 CONFIRMATIONS_LOG_ERROR
#endif
#define BVLOG(severity) \
confirmations_client_->VerboseLog(__FILE__, __LINE__, severity)->stream()

#endif // BAT_CONFIRMATIONS_LOGGING_H_

0 comments on commit fc7de34

Please sign in to comment.