blob: 330a4db09d447d9fa8bf2bfe247cfdbd4e12be15 [file] [log] [blame]
Armando Montanez0054a9b2020-03-13 13:06:24 -07001.. _chapter-pw-log-basic:
2
3.. default-domain:: cpp
4
5.. highlight:: sh
6
7------------
8pw_log_basic
9------------
Wyatt Hepler2ccde062020-09-16 21:58:53 -070010``pw_log_basic`` is a ``pw_log backend`` that sends logs over ``pw_sys_io`` by
11default. The destination of ``pw_sys_io`` depends on the ``pw_sys_io`` backend
12in use. This is controlled by the ``dir_pw_sys_io_backend`` variable in a
13target's ``target_config.gni``.
14
15The log output may be changed from ``pw_sys_io`` to an arbitrary function by
16calling ``pw::log_basic::SetOutput``.
17
18.. cpp:namespace:: pw::log_basic
19
20.. cpp:function:: void SetOutput(void (\*log_output)(std::string_view))
21
22 Set the log output function, which defaults ``pw_sys_io::WriteLine``. This
23 function is called with each formatted log message.
Armando Montanez0054a9b2020-03-13 13:06:24 -070024
25This module employs an internal buffer for formatting log strings, and currently
26has a fixed size of 150 bytes. Any final log statements that are larger than
27149 bytes (one byte used for a null terminator) will be truncated.
28
29.. note::
30 The documentation for this module is currently incomplete.