diff options
author | Benjamin Barenblat <bbaren@google.com> | 2021-07-06 19:57:09 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2021-07-06 19:57:09 -0400 |
commit | fe480f5e29f212efd5b933475cc6e71fc5937f4d (patch) | |
tree | fc274e0a34ea889f6933618393533fdcfa188a65 /log.cc | |
parent | bbec3b57e296543c5005b93ad1d74c6e3ad34a40 (diff) |
Add CHECK macro to logging framework
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
Diffstat (limited to 'log.cc')
-rw-r--r-- | log.cc | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,17 @@ +#include "log.h" + +#include <absl/strings/substitute.h> +#include <stdlib.h> + +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 |