From 80214d755e61aba2218f710b7a07f083c97843b1 Mon Sep 17 00:00:00 2001 From: Adam Shapiro Date: Tue, 20 Aug 2024 17:48:09 -0400 Subject: [PATCH] Explicitly separate P1_NO_PRINT in polaris_client.cc. --- src/point_one/polaris/polaris_client.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/point_one/polaris/polaris_client.cc b/src/point_one/polaris/polaris_client.cc index 25a916e..c0887fb 100644 --- a/src/point_one/polaris/polaris_client.cc +++ b/src/point_one/polaris/polaris_client.cc @@ -8,7 +8,17 @@ #include -#if defined(POLARIS_NO_GLOG) +#if defined(P1_NO_PRINT) +#include +static std::ostream null_stream(0); +#define LOG(severity) null_stream +#define VLOG(severity) null_stream +#define VLOG_IS_ON(severity) false +#define LOG_INFO_STREAM(filename, line) null_stream +#define LOG_WARNING_STREAM(filename, line) null_stream +#define LOG_ERROR_STREAM(filename, line) null_stream + +#elif defined(POLARIS_NO_GLOG) #include // Reference: @@ -36,25 +46,20 @@ class Stream { static Stream cerr_stream; static std::ostream null_stream(0); -#if defined(P1_NO_PRINT) -#define LOG(severity) null_stream -#define VLOG(severity) null_stream -#define VLOG_IS_ON(severity) false -#else // !defined(P1_NO_PRINT) #define LOG(severity) cerr_stream #if defined(POLARIS_DEBUG) #define VLOG(severity) cerr_stream #define VLOG_IS_ON(severity) true -#else +#else // !defined(POLARIS_DEBUG) #define VLOG(severity) null_stream #define VLOG_IS_ON(severity) false -#endif // defined(P1_NO_PRINT) #endif // defined(POLARIS_DEBUG) #define LOG_INFO_STREAM(filename, line) LOG(INFO) #define LOG_WARNING_STREAM(filename, line) LOG(WARNING) #define LOG_ERROR_STREAM(filename, line) LOG(ERROR) -#else + +#else // !defined(P1_NO_PRINT) && !defined(POLARIS_NO_GLOG) #include #if GOOGLE_STRIP_LOG == 0