diff --git a/components/log/Kconfig.format b/components/log/Kconfig.format index e743dabff2..af11271880 100644 --- a/components/log/Kconfig.format +++ b/components/log/Kconfig.format @@ -7,6 +7,9 @@ menu "Format" Enable ANSI terminal color codes. In order to view these, your terminal program must support ANSI color codes. + This is disabled by default, as colors are added in IDF Monitor. If you want to use new lines + in the messages or you are using a different terminal program, you may want to enable this option. + choice LOG_TIMESTAMP_SOURCE prompt "Timestamp" default LOG_TIMESTAMP_SOURCE_RTOS diff --git a/docs/en/api-guides/tools/idf-monitor.rst b/docs/en/api-guides/tools/idf-monitor.rst index 9505a76210..c6ccb346ef 100644 --- a/docs/en/api-guides/tools/idf-monitor.rst +++ b/docs/en/api-guides/tools/idf-monitor.rst @@ -40,10 +40,10 @@ For easy interaction with IDF Monitor, use the keyboard shortcuts given in the t - Resets the target board and re-starts the application via the RTS line (if connected). * - * Ctrl + F - Build and flash the project - - Pauses idf_monitor to run the project ``flash`` target, then resumes idf_monitor. Any changed source files are recompiled and then re-flashed. Target ``encrypted-flash`` is run if idf_monitor was started with argument ``-E``. + - Pauses idf_monitor to run the project ``flash`` target, then resumes idf_monitor. Any changed source files are recompiled and then re-flashed. Target ``encrypted-flash`` is run if idf_monitor was started with argument ``-E``. * - * Ctrl + A (or A) - Build and flash the app only - - Pauses idf_monitor to run the ``app-flash`` target, then resumes idf_monitor. Similar to the ``flash`` target, but only the main app is built and re-flashed. Target ``encrypted-app-flash`` is run if idf_monitor was started with argument ``-E``. + - Pauses idf_monitor to run the ``app-flash`` target, then resumes idf_monitor. Similar to the ``flash`` target, but only the main app is built and re-flashed. Target ``encrypted-app-flash`` is run if idf_monitor was started with argument ``-E``. * - * Ctrl + Y - Stop/resume log output printing on screen - Discards all incoming serial data while activated. Allows to quickly pause and examine log output without quitting the monitor. @@ -66,6 +66,21 @@ For easy interaction with IDF Monitor, use the keyboard shortcuts given in the t Any keys pressed, other than ``Ctrl-]`` and ``Ctrl-T``, will be sent through the serial port. +Automatic Coloring +================== + +IDF Monitor automatically colors the output based on the log level. This feature reduces the number of bytes transferred over the serial console by avoiding redundant log formatting, which can improve performance by reducing latency in log transmission. +Other benefits include adding colors to precompiled libraries (such as Wi-Fi) and reduced binary size of the application. +The automatic coloring is enabled by default. To disable it, use the command line option ``--disable-auto-color``. + +The coloring is done based on the log level followed by optional timestamp and tag. For option to enable coloring on the {IDF_TARGET_NAME} side, see :ref:`CONFIG_LOG_COLORS`. +For more details on the log, see :doc:`Logging <../../api-reference/system/log>`. + +.. note:: + + The automatic coloring will not work properly if the message contains new lines. In this case the IDF Monitor will only color the first line of the message. + + ESP-IDF-specific Features ========================= @@ -349,7 +364,12 @@ For more details on the configuration file, see the `IDF Monitor documentation`_ Known Issues with IDF Monitor ============================= -If you encounter any issues while using IDF Monitor, check our `GitHub repository `_ for a list of known issues and their current status. If you come across a problem that hasn't been documented yet, we encourage you to create a new issue report. +The following issues are currently known: + +- Autocoloring cannot detect the log level if the message contains new lines. In this case, the IDF Monitor will only color the first line of the message. + To work around this issue, enable :ref:`CONFIG_LOG_COLORS` in menuconfig. Please note that this might have some impact on binary size and performance. + +If you experience any other issues while using IDF Monitor, check our `GitHub repository `_ for a list of known issues and their current status. If you come across a problem that hasn't been documented yet, we encourage you to create a new issue report. .. _esp-idf-monitor: https://github.com/espressif/esp-idf-monitor .. _IDF Monitor documentation: https://github.com/espressif/esp-idf-monitor/blob/v1.5.0/README.md#documentation