mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-09-20 03:11:17 +02:00
Clarify docs for logger, globals (#2323)
This commit is contained in:
parent
0354a78e1c
commit
3c4acf2e6a
@ -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:
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user