Commit efeb95f4 by Wiktor Garbacz Committed by Copybara-Service

Add `ABSL_UNREACHABLE()` to `ABSL_RAW_LOG` when severity is `FATAL`

Also makes `ABSL_INTERNAL_LOG(LEVEL(x), "oops")` not call unreachable (even when x == kFatal) for consistency.

PiperOrigin-RevId: 517894304
Change-Id: I798b1032d126330ace1e2b48edd8fc547a2ad2f8
parent 0697762c
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity, \ ::absl::raw_log_internal::RawLog(ABSL_RAW_LOG_INTERNAL_##severity, \
absl_raw_log_internal_basename, __LINE__, \ absl_raw_log_internal_basename, __LINE__, \
__VA_ARGS__); \ __VA_ARGS__); \
ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity; \
} while (0) } while (0)
// Similar to CHECK(condition) << message, but for low-level modules: // Similar to CHECK(condition) << message, but for low-level modules:
...@@ -77,8 +78,7 @@ ...@@ -77,8 +78,7 @@
::absl::raw_log_internal::internal_log_function( \ ::absl::raw_log_internal::internal_log_function( \
ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \ ABSL_RAW_LOG_INTERNAL_##severity, absl_raw_log_internal_filename, \
__LINE__, message); \ __LINE__, message); \
if (ABSL_RAW_LOG_INTERNAL_##severity == ::absl::LogSeverity::kFatal) \ ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_##severity; \
ABSL_UNREACHABLE(); \
} while (0) } while (0)
#define ABSL_INTERNAL_CHECK(condition, message) \ #define ABSL_INTERNAL_CHECK(condition, message) \
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
#define ABSL_RAW_LOG_INTERNAL_LEVEL(severity) \ #define ABSL_RAW_LOG_INTERNAL_LEVEL(severity) \
::absl::NormalizeLogSeverity(severity) ::absl::NormalizeLogSeverity(severity)
#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_INFO
#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_WARNING
#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_ERROR
#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_FATAL ABSL_UNREACHABLE()
#define ABSL_RAW_LOG_INTERNAL_MAYBE_UNREACHABLE_LEVEL(severity)
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
namespace raw_log_internal { namespace raw_log_internal {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment