pw_log_basic: Allow setting a log output function

Change-Id: I2b575df9e1006f6d0a35a1ab90f4f43df8f983e3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18320
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
diff --git a/pw_log_basic/docs.rst b/pw_log_basic/docs.rst
index 2b8ca41..330a4db 100644
--- a/pw_log_basic/docs.rst
+++ b/pw_log_basic/docs.rst
@@ -7,11 +7,20 @@
 ------------
 pw_log_basic
 ------------
-``pw_log_basic`` is a ``pw_log backend`` that sends logs over ``pw_sys_io``. The
-destination of ``pw_sys_io`` depends on the ``pw_sys_io`` backend in use. This
-is controlled by the ``dir_pw_sys_io_backend`` variable in a target's
-``target_config.gni``.
-information.
+``pw_log_basic`` is a ``pw_log backend`` that sends logs over ``pw_sys_io`` by
+default. The destination of ``pw_sys_io`` depends on the ``pw_sys_io`` backend
+in use. This is controlled by the ``dir_pw_sys_io_backend`` variable in a
+target's ``target_config.gni``.
+
+The log output may be changed from ``pw_sys_io`` to an arbitrary function by
+calling ``pw::log_basic::SetOutput``.
+
+.. cpp:namespace:: pw::log_basic
+
+.. cpp:function:: void SetOutput(void (\*log_output)(std::string_view))
+
+  Set the log output function, which defaults ``pw_sys_io::WriteLine``. This
+  function is called with each formatted log message.
 
 This module employs an internal buffer for formatting log strings, and currently
 has a fixed size of 150 bytes. Any final log statements that are larger than