From fe480f5e29f212efd5b933475cc6e71fc5937f4d Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Tue, 6 Jul 2021 19:57:09 -0400 Subject: Add CHECK macro to logging framework Reviewed-by: Alex Chernyakhovsky --- log.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 log.cc (limited to 'log.cc') diff --git a/log.cc b/log.cc new file mode 100644 index 0000000..13b74d7 --- /dev/null +++ b/log.cc @@ -0,0 +1,17 @@ +#include "log.h" + +#include +#include + +namespace gsrsup { + +void Check(Log& log, bool condition, const char* condition_str, + const char* file, int line) { + if (!condition) { + log.Error(absl::Substitute("internal error ($0:$1): ", file, line), + condition_str); + exit(1); + } +} + +} // namespace gsrsup -- cgit v1.2.3