Wyatt Hepler | f9fb90f | 2020-09-30 18:59:33 -0700 | [diff] [blame] | 1 | .. _module-pw_log_null: |
Wyatt Hepler | 24a6e27 | 2020-09-01 10:25:28 -0700 | [diff] [blame] | 2 | |
| 3 | ----------- |
| 4 | pw_log_null |
| 5 | ----------- |
| 6 | ``pw_log_null`` is a ``pw_log backend`` that ignores all ``pw_log`` statements. |
| 7 | The backend implements ``PW_LOG`` with an empty inline function. Using an empty |
| 8 | function ensures that the arguments are evaluated and their types are correct. |
| 9 | Since the function is inline in the header, the compiler will optimize out the |
| 10 | function call. |
| 11 | |
| 12 | This backend can be used to completely disable ``pw_log``, which may be helpful |
| 13 | in certain development situations (e.g. to avoid circular dependencies). |
| 14 | |
| 15 | .. tip:: |
| 16 | If you are concerned about the resource demands of logging, try tokenizing |
Wyatt Hepler | f9fb90f | 2020-09-30 18:59:33 -0700 | [diff] [blame] | 17 | logs with :ref:`module-pw_tokenizer` and :ref:`module-pw_log_tokenized` |
Wyatt Hepler | 24a6e27 | 2020-09-01 10:25:28 -0700 | [diff] [blame] | 18 | instead of disabling logs completely. Tokenized logs provide exactly same |
| 19 | information as plain text logs but use dramatically less resources. |