summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-20 10:35:40 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-20 10:36:14 -0400
commitae01864b5d3bc8a5e3b069025d9d7972ff1a21c3 (patch)
treec0c22b78ac3c9b02e07c01fe05972ac3c231853e /src/common/log.c
parent9fa73003fca5e884c0c663c2035ce6e60994c339 (diff)
downloadtor-ae01864b5d3bc8a5e3b069025d9d7972ff1a21c3.tar.gz
tor-ae01864b5d3bc8a5e3b069025d9d7972ff1a21c3.zip
Add raw_assert() variants for cases where we cannot log.
Remove a different raw_assert() macro declared in log.c
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/common/log.c b/src/common/log.c
index 7ba669818f..2f5fdbc17d 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -50,8 +50,6 @@
#define TRUNCATED_STR_LEN 14
/** @} */
-#define raw_assert(x) assert(x) // assert OK
-
/** Defining compile-time constants for Tor log levels (used by the Rust
* log wrapper at src/rust/tor_log) */
const int LOG_WARN_ = LOG_WARN;
@@ -89,9 +87,9 @@ sev_to_string(int severity)
case LOG_NOTICE: return "notice";
case LOG_WARN: return "warn";
case LOG_ERR: return "err";
- default: /* Call assert, not tor_assert, since tor_assert
- * calls log on failure. */
- raw_assert(0); return "UNKNOWN"; // LCOV_EXCL_LINE
+ default: /* Call assert, not tor_assert, since tor_assert
+ * calls log on failure. */
+ raw_assert_unreached(); return "UNKNOWN"; // LCOV_EXCL_LINE
}
}
@@ -1536,4 +1534,3 @@ truncate_logs(void)
}
}
}
-