From cc370fb042be8449f5d0019dc26b49051d19fb41 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:52:00 +0100 Subject: [PATCH 1/2] Added missing debug-logging macros --- src/glog/logging.h.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in index 0a7ebd255..94ab6f5c5 100644 --- a/src/glog/logging.h.in +++ b/src/glog/logging.h.in @@ -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(0), \ (true || !(condition))? (void) 0 : @ac_google_namespace@::LogMessageVoidify() & LOG(severity) +#define DLOG_FIRST_N(severity, n) \ + static_cast(0), \ + true ? (void) 0 : @ac_google_namespace@::LogMessageVoidify() & LOG(severity) + +#define DLOG_EVERY_T(severity, T) \ + static_cast(0), \ + true ? (void) 0 : @ac_google_namespace@::LogMessageVoidify() & LOG(severity) + #define DLOG_ASSERT(condition) \ static_cast(0), \ true ? (void) 0 : LOG_ASSERT(condition) From b40459f7715ae4d983d9f9e6af4067cdc2cf0633 Mon Sep 17 00:00:00 2001 From: 4c3y <69460051+4c3y@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:36:42 +0100 Subject: [PATCH 2/2] Added new debug macros to README.rst --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 37ad740ba..87f3da64f 100644 --- a/README.rst +++ b/README.rst @@ -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