pw_assert_log#

Pigweed AI summary: The pw_assert_log module is an assert backend that implements the pw_assert:check facade by routing PW_CHECK() and PW_CRASH() macros into PW_LOG with the PW_LOG_LEVEL_FATAL log level. This allows for easy tokenization of assert messages using the pw_log_tokenized log backend for logging and routing the tokenized messages into the tokenized log handler using pw_assert_log. To use this module, set the assert backend to pw_assert_BACKEND = dir_pw_assert_log and ensure the logging backend can

pw_assert_BACKEND#

Pigweed AI summary: This paragraph describes the implementation of the pw_assert_BACKEND, which routes PW_CHECK() and PW_CRASH() macros into PW_LOG with the PW_LOG_LEVEL_FATAL log level. This allows for easy tokenization of assert messages using the pw_log_tokenized log backend and pw_assert_log to route the tokenized messages into the tokenized log handler. To use this module, set the assert backend to pw_assert_BACKEND and ensure the logging backend can handle the assert failure flag.

This assert backend implements the pw_assert:check facade, by routing the PW_CHECK()/PW_CRASH() macros into PW_LOG with the PW_LOG_LEVEL_FATAL log level. This is an easy way to tokenize your assert messages, by using the pw_log_tokenized log backend for logging, then using pw_assert_log to route the tokenized messages into the tokenized log handler.

To use this module:

  1. Set your assert backend: pw_assert_BACKEND = dir_pw_assert_log

  2. Ensure your logging backend knows how to handle the assert failure flag

pw_assert_LITE_BACKEND#

Pigweed AI summary: The pw_assert_LITE_BACKEND implements the pw_assert:assert facade by routing PW_ASSERT() macros into PW_LOG with the PW_LOG_LEVEL_FATAL log level. This allows for easy forwarding of asserts to a native macro assert API if it is already constexpr safe, such as on Android.

This assert backend implements the pw_assert:assert facade, by routing the PW_ASSERT() macros into PW_LOG with the PW_LOG_LEVEL_FATAL log level. This is an easy way to forward your asserts to a native macro assert API if it is already constexpr safe such as on Android.