blob: fa7466fe96f80c9adcafec50a01298c04388f53c [file] [log] [blame]
Wyatt Heplerf9fb90f2020-09-30 18:59:33 -07001.. _module-pw_log_null:
Wyatt Hepler24a6e272020-09-01 10:25:28 -07002
3-----------
4pw_log_null
5-----------
6``pw_log_null`` is a ``pw_log backend`` that ignores all ``pw_log`` statements.
7The backend implements ``PW_LOG`` with an empty inline function. Using an empty
8function ensures that the arguments are evaluated and their types are correct.
9Since the function is inline in the header, the compiler will optimize out the
10function call.
11
12This backend can be used to completely disable ``pw_log``, which may be helpful
13in 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 Heplerf9fb90f2020-09-30 18:59:33 -070017 logs with :ref:`module-pw_tokenizer` and :ref:`module-pw_log_tokenized`
Wyatt Hepler24a6e272020-09-01 10:25:28 -070018 instead of disabling logs completely. Tokenized logs provide exactly same
19 information as plain text logs but use dramatically less resources.