feat: add missing debug logging macros (#986)

This commit is contained in:
Acey 2023-12-21 10:45:06 -08:00 committed by GitHub
parent 6607b369d0
commit 716be9edc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -388,6 +388,8 @@ excessive logging.
DLOG(INFO) << "Found cookies";
DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies";
DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
DLOG_FIRST_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie";
DLOG_EVERY_T(INFO, 0.01) << "Got a cookie";
``CHECK`` Macros

View File

@ -1175,6 +1175,8 @@ const LogSeverity GLOG_0 = GLOG_ERROR;
#define DLOG_EVERY_N(severity, n) LOG_EVERY_N(severity, n)
#define DLOG_IF_EVERY_N(severity, condition, n) \
LOG_IF_EVERY_N(severity, condition, n)
#define DLOG_FIRST_N(severity, n) LOG_FIRST_N(severity, n)
#define DLOG_EVERY_T(severity, T) LOG_EVERY_T(severity, T)
#define DLOG_ASSERT(condition) LOG_ASSERT(condition)
// debug-only checking. executed if DCHECK_IS_ON().
@ -1214,6 +1216,14 @@ const LogSeverity GLOG_0 = GLOG_ERROR;
static_cast<void>(0), \
(true || !(condition))? (void) 0 : @ac_google_namespace@::LogMessageVoidify() & LOG(severity)
#define DLOG_FIRST_N(severity, n) \
static_cast<void>(0), \
true ? (void) 0 : @ac_google_namespace@::LogMessageVoidify() & LOG(severity)
#define DLOG_EVERY_T(severity, T) \
static_cast<void>(0), \
true ? (void) 0 : @ac_google_namespace@::LogMessageVoidify() & LOG(severity)
#define DLOG_ASSERT(condition) \
static_cast<void>(0), \
true ? (void) 0 : LOG_ASSERT(condition)