blob: 3fa0d3aab208d2a193f39583390eb8a4fbc6e2fc [file] [log] [blame]
Wyatt Heplerf9fb90f2020-09-30 18:59:33 -07001.. _module-pw_assert_log:
Keir Mierleb776cb22020-08-14 16:46:50 -07002
3=============
4pw_assert_log
5=============
6
Ewout van Bekkum2b422682022-02-25 13:28:53 -08007-----------------
8pw_assert_BACKEND
9-----------------
10This assert backend implements the ``pw_assert:check`` facade, by routing the
11``PW_CHECK()``/``PW_CRASH()`` macros into ``PW_LOG`` with the
12``PW_LOG_LEVEL_FATAL`` log level. This is an easy way to tokenize your assert
13messages, by using the ``pw_log_tokenized`` log backend for logging, then using
14``pw_assert_log`` to route the tokenized messages into the tokenized log
15handler.
Keir Mierleb776cb22020-08-14 16:46:50 -070016
17To use this module:
18
191. Set your assert backend: ``pw_assert_BACKEND = dir_pw_assert_log``
202. Ensure your logging backend knows how to handle the assert failure flag
Ewout van Bekkum2b422682022-02-25 13:28:53 -080021
22----------------------
23pw_assert_LITE_BACKEND
24----------------------
25This assert backend implements the ``pw_assert:assert`` facade, by routing the
26``PW_ASSERT()`` macros into ``PW_LOG`` with the ``PW_LOG_LEVEL_FATAL`` log
27level. This is an easy way to forward your asserts to a native macro assert
28API if it is already constexpr safe such as on Android.