1 .. _module-pw_log_basic:
6 ``pw_log_basic`` is a ``pw_log backend`` that sends logs over ``pw_sys_io`` by
7 default. The destination of ``pw_sys_io`` depends on the ``pw_sys_io`` backend
8 in use. This is controlled by the ``dir_pw_sys_io_backend`` variable in a
9 target's ``target_config.gni``.
11 The log output may be changed from ``pw_sys_io`` to an arbitrary function by
12 calling ``pw::log_basic::SetOutput``.
14 .. cpp:namespace:: pw::log_basic
16 .. cpp:function:: void SetOutput(void (\*log_output)(std::string_view))
18 Set the log output function, which defaults ``pw_sys_io::WriteLine``. This
19 function is called with each formatted log message.
21 This module employs an internal buffer for formatting log strings, and currently
22 has a fixed size of 150 bytes. Any final log statements that are larger than
23 149 bytes (one byte used for a null terminator) will be truncated.
26 The documentation for this module is currently incomplete.