diff --git a/components/logger.rst b/components/logger.rst index 8fde1c656..b059efbba 100644 --- a/components/logger.rst +++ b/components/logger.rst @@ -6,9 +6,10 @@ Logger Component :image: file-document-box.svg The logger component automatically logs all log messages through the -serial port and through MQTT topics. By default, all logs with a -severity higher than ``DEBUG`` will be shown. Decreasing the log level -can help with the performance of the application and memory size. +serial port and through MQTT topics (if there is an MQTT client in the +configuration). By default, all logs with a severity higher than +``DEBUG`` will be shown. Decreasing the log level can help with the +performance of the application and memory size. .. code-block:: yaml @@ -54,7 +55,9 @@ The logger component makes use of platform-specific hardware UARTs for serial lo By default, the logger will occupy ``UART0``. The ESP32 has three hardware UARTs, all of which can be used for both transmit and receive. The ESP8266 only has two hardware UARTs, one of which is transmit-only. The ESP8266 ``UART0`` can also be 'swapped' to TX/RX on the -CTS/RTS pins, if you need to use GPIO1 and GPIO3 for something else. +CTS/RTS pins, if you need to use GPIO1 and GPIO3 for something else. Note that the common +NodeMCU boards have their USB-UART Adapters fixed to the default GPIOs used by ``UART0``, +so if you use anything else you will not get log messages over the on-board USB. Possible Hardware UART configurations: diff --git a/guides/automations.rst b/guides/automations.rst index 3e11e91f0..e2fce2238 100644 --- a/guides/automations.rst +++ b/guides/automations.rst @@ -274,7 +274,7 @@ global variables can be used to store the state of a garage door. - id: my_global_string type: std::string restore_value: no # Strings cannot be saved/restored - initial_value: '"hello world"' + initial_value: '"Global value is"' # In an automation on_press: @@ -287,7 +287,7 @@ global variables can be used to store the state of a garage door. id(my_global_int) += 10; } - ESP_LOGD(TAG, "Global value is: %d", id(my_global_int)); + ESP_LOGD(TAG, "%s: %d", id(my_global_string), id(my_global_int)); Configuration variables: