diff --git a/docs/en/api-guides/app_trace.rst b/docs/en/api-guides/app_trace.rst index 1feafd7478..7bb06b6ada 100644 --- a/docs/en/api-guides/app_trace.rst +++ b/docs/en/api-guides/app_trace.rst @@ -292,7 +292,7 @@ How To Use It In order to use logging via trace module, users need to perform the following steps: -1. On the target side, the special vprintf-like function ``esp_apptrace_vprintf`` needs to be installed. It sends log data to the host. Example usage ``esp_log_set_vprintf(esp_apptrace_vprintf);``. To send log data to uart again ``esp_log_set_vprintf(vprintf);`` +1. On the target side, the special vprintf-like function :cpp:func:`esp_apptrace_vprintf` needs to be installed. It sends log data to the host. An example is ``esp_log_set_vprintf(esp_apptrace_vprintf);``. To send log data to UART again, use ``esp_log_set_vprintf(vprintf);``. 2. Follow instructions in items 2-5 in `Application Specific Tracing`_. 3. To print out collected log records, run the following command in terminal: ``$IDF_PATH/tools/esp_app_trace/logtrace_proc.py /path/to/trace/file /path/to/program/elf/file``. diff --git a/docs/zh_CN/api-guides/app_trace.rst b/docs/zh_CN/api-guides/app_trace.rst index 7fbc2c2616..f72329b0b9 100644 --- a/docs/zh_CN/api-guides/app_trace.rst +++ b/docs/zh_CN/api-guides/app_trace.rst @@ -292,7 +292,7 @@ ESP-IDF 的日志库会默认使用类 vprintf 的函数将格式化的字符串 为了使用跟踪模块来记录日志,用户需要执行以下步骤: -1. 在目标端,需要安装特殊的类 vprintf 函数 ``esp_apptrace_vprintf``,该函数负责将日志数据发送给主机。示例代码参见。 +1. 在目标端,需要安装特殊的类 vprintf 函数 :cpp:func:`esp_apptrace_vprintf`,该函数负责将日志数据发送给主机,使用方法为 ``esp_log_set_vprintf(esp_apptrace_vprintf);``。如需将日志数据再次重定向给 UART,请使用 ``esp_log_set_vprintf(vprintf);``。 2. 按照 :ref:`app_trace-application-specific-tracing` 章节中的第 2-5 步进行操作。 3. 打印接收到的日志记录,请在终端运行以下命令:``$IDF_PATH/tools/esp_app_trace/logtrace_proc.py /path/to/trace/file /path/to/program/elf/file``。