mirror of
https://github.com/espressif/esp-idf.git
synced 2026-01-21 22:28:27 +00:00
docs: Update CN translation
This commit is contained in:
committed by
Peter Dragun
parent
00365a4b07
commit
6e321e3dae
@@ -196,9 +196,7 @@ The logging system supports the following formatting options, applicable for bot
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that IDF Monitor expects the format described above of log messages to automatically color logs. The minimal required format is log level name followed by timestamp. A newline marks the end of the log message. E.g., ``I (56): Log message\n``
|
||||
If this format is not followed, for example by disabling the timestamp, then automatic log coloring will not work. In such situations, it is recommended to enable :ref:`CONFIG_LOG_COLORS` in the menuconfig.
|
||||
Another related restriction is for multi-line logs where only the first line will be colored correctly.
|
||||
Please note that IDF Monitor requires the log message format described above in order to apply color highlighting automatically. The minimum required format is a log level name followed by a timestamp, and each log message must end with a newline character. For example, ``I (56): Log message\n``. If this format is not followed, such as when the timestamp is disabled, automatic log coloring will not work. In these cases, it is recommended to enable :ref:`CONFIG_LOG_COLORS` in the menuconfig. Another limitation is that for multi-line log messages, only the first line will be colored correctly.
|
||||
|
||||
- **Level Name**: A single letter (I, W, E, D, V) indicating log verbosity, displayed at the start of each message. Useful for identifying log levels, especially when color is disabled, as utilized by the ESP-IDF monitor tool.
|
||||
|
||||
|
||||
@@ -194,6 +194,10 @@ ESP-IDF 提供了一套灵活的日志系统,包括两个可配置版本 **Log
|
||||
|
||||
- 对于 **Log V2**,选项 :ref:`CONFIG_LOG_COLORS_SUPPORT` 支持在运行时为特定日志、文件或组件添加颜色输出,即使全局颜色已禁用。此时要为特定上下文启用颜色,请使用 ``ESP_LOG_COLOR_DISABLED``。
|
||||
|
||||
.. note::
|
||||
|
||||
IDF Monitor 需要依据上述日志消息格式,才能自动为日志添加颜色高亮效果。对格式的最低要求是:日志级别名称后接时间戳,且每条日志消息必须以换行符结尾。例如,``I (56): Log message\n``。如果未遵循此格式(例如禁用了时间戳),自动日志着色将失效。在这种情况下,建议在 menuconfig 中启用 :ref:`CONFIG_LOG_COLORS` 配置项。此外还有一个限制,即对于多行日志消息,只有第一行会被正确着色。
|
||||
|
||||
- **Level Name**:表示日志详细级别的单个字母(I, W, E, D, V),显示在每条日志消息的开头,用于识别日志级别。这在禁用颜色时非常有用,例如在禁用颜色时 ESP-IDF 监视工具就会使用该信息。
|
||||
|
||||
- **Timestamp**:为日志消息全局添加时间戳。由 :ref:`CONFIG_LOG_TIMESTAMP_SOURCE` 控制。
|
||||
|
||||
Reference in New Issue
Block a user