Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pw_log_null: Prevent asserts being routed to pw_log_null
pw_assert_log routes asserts to pw_log. If pw_log_null is in use, those asserts do nothing, which is dangerous. Similarly, a PW_LOG(PW_LOG_LEVEL_FATAL, ...) message does nothing with pw_log_null. Prevent fatal logs or asserts from doing nothing in pw_log_null by failing to compile. This is done by checking the log level in a static_assert. Note that this also prevents pw_log_null from working with non-constant log levels. Change-Id: I87d645115f5053ebad5127bda67b088a632ed562 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/262853 Docs-Not-Needed: Wyatt Hepler <[email protected]> Presubmit-Verified: CQ Bot Account <[email protected]> Lint: Lint 🤖 <[email protected]> Pigweed-Auto-Submit: Wyatt Hepler <[email protected]> Commit-Queue: Auto-Submit <[email protected]> Reviewed-by: Dave Roth <[email protected]>
- Loading branch information