Skip to content

Commit fd3178e

Browse files
peterdragunespressif-bot
authored andcommitted
docs(tools/idf-monitor): Add note about autocoloring limitation on multiline logs
Closes espressif#15793
1 parent 39c6c70 commit fd3178e

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

components/log/Kconfig.format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ menu "Format"
88
Enable ANSI terminal color codes. Logs (info, errors, warnings) will contain color codes.
99
In order to view these, your terminal program must support ANSI color codes.
1010

11+
This is disabled by default, as colors are added in IDF Monitor. If you want to use new lines
12+
in the messages or you are using a different terminal program, you may want to enable this option.
13+
1114
config LOG_COLORS_SUPPORT
1215
bool "Allow enabling color output at run time"
1316
depends on LOG_VERSION_2

docs/en/api-guides/tools/idf-monitor.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ For easy interaction with IDF Monitor, use the keyboard shortcuts given in the t
4040
- Resets the target board and re-starts the application via the RTS line (if connected).
4141
* - * Ctrl + F
4242
- Build and flash the project
43-
- 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``.
43+
- 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``.
4444
* - * Ctrl + A (or A)
4545
- Build and flash the app only
46-
- 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``.
46+
- 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``.
4747
* - * Ctrl + Y
4848
- Stop/resume log output printing on screen
4949
- 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
6666
Any keys pressed, other than ``Ctrl-]`` and ``Ctrl-T``, will be sent through the serial port.
6767

6868

69+
Automatic Coloring
70+
==================
71+
72+
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.
73+
Other benefits include adding colors to precompiled libraries (such as Wi-Fi) and reduced binary size of the application.
74+
The automatic coloring is enabled by default. To disable it, use the command line option ``--disable-auto-color``.
75+
76+
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`.
77+
For more details on the log, see :doc:`Logging <../../api-reference/system/log>`.
78+
79+
.. note::
80+
81+
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.
82+
83+
6984
ESP-IDF-specific Features
7085
=========================
7186

@@ -351,6 +366,9 @@ Known Issues with IDF Monitor
351366

352367
The following issues are currently known:
353368

369+
- 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.
370+
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.
371+
354372
- On Windows, if the terminal is closed without first closing the IDF Monitor, some drivers may fail to release the serial port. To release the port, you may need to unplug and replug the USB cable, or in some cases even restart the computer. This issue has been observed with the CH9102 USB-to-UART bridge. Other drivers, such as CP210x and CH340, should work fine.
355373

356374
To prevent this issue, make sure to close the IDF Monitor properly before exiting the terminal, or consider using an alternative USB-to-UART bridge.

0 commit comments

Comments
 (0)