• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. _module-pw_assert-backends:
2
3========
4Backends
5========
6.. pigweed-module-subpage::
7   :name: pw_assert
8
9.. TODO: b/323607687 - Add backend guidance here
10
11The following backends are already implemented and available for use in your
12projects:
13
14- ``pw_assert:print_and_abort_backend`` - **Stable** - Uses the ``printf`` and
15  ``abort`` standard library functions to implement the assert facade. Prints
16  the assert expression, evaluated arguments if any, file/line, function name,
17  and user message, then aborts. Only suitable for targets that support these
18  standard library functions.
19- :ref:`module-pw_assert_basic` - **Stable** - The assert basic module is a
20  simple assert handler that displays the failed assert line and the values of
21  captured arguments. Output is directed to ``pw_sys_io``. This module is a
22  great ready-to-roll module when bringing up a system, but is likely not the
23  best choice for production.
24- :ref:`module-pw_assert_log` - **Stable** - This assert backend redirects to
25  logging, but with a logging flag set that indicates an assert failure. This
26  is our advised approach to get **tokenized asserts**--by using tokenized
27  logging, then using the ``pw_assert_log`` backend.
28
29.. toctree::
30   :maxdepth: 1
31
32   Basic <../pw_assert_basic/docs>
33   Pigweed logging <../pw_assert_log/docs>
34   Fuchsia <../pw_assert_fuchsia/docs>
35   Tokenized <../pw_assert_tokenized/docs>
36   Trap <../pw_assert_trap/docs>
37   Zephyr <../pw_assert_zephyr/docs>
38