blob: 6b80809b9f135db529ee09face94e873a6191fd7 [file] [log] [blame]
.. _chapter-pw-log-null:
.. default-domain:: cpp
.. highlight:: sh
-----------
pw_log_null
-----------
``pw_log_null`` is a ``pw_log backend`` that ignores all ``pw_log`` statements.
The backend implements ``PW_LOG`` with an empty inline function. Using an empty
function ensures that the arguments are evaluated and their types are correct.
Since the function is inline in the header, the compiler will optimize out the
function call.
This backend can be used to completely disable ``pw_log``, which may be helpful
in certain development situations (e.g. to avoid circular dependencies).
.. tip::
If you are concerned about the resource demands of logging, try tokenizing
logs with :ref:`chapter-pw-tokenizer` and :ref:`chapter-pw-log-tokenized`
instead of disabling logs completely. Tokenized logs provide exactly same
information as plain text logs but use dramatically less resources.