mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
Merge remote-tracking branch 'upstream/fix-logger-init-order-14970' into integration
This commit is contained in:
@@ -324,7 +324,7 @@ CONFIG_SCHEMA = cv.All(
|
||||
)
|
||||
|
||||
|
||||
@coroutine_with_priority(CoroPriority.LOGGER_INIT)
|
||||
@coroutine_with_priority(CoroPriority.EARLY_INIT)
|
||||
async def to_code(config: ConfigType) -> None:
|
||||
baud_rate: int = config[CONF_BAUD_RATE]
|
||||
level = config[CONF_LEVEL]
|
||||
|
||||
@@ -63,11 +63,11 @@ class CoroPriority(enum.IntEnum):
|
||||
resolution during code generation.
|
||||
"""
|
||||
|
||||
# Logger early init - must run before all other code because:
|
||||
# 1. All code assumes global_logger is ready for ESP_LOG* calls
|
||||
# 2. Without this, any log call before logger init dereferences nullptr
|
||||
# Early init - runs before platform init and before Application exists.
|
||||
# Currently used only to connect logging so ESP_LOG* calls work
|
||||
# immediately in all subsequent phases.
|
||||
# Examples: logger (1100)
|
||||
LOGGER_INIT = 1100
|
||||
EARLY_INIT = 1100
|
||||
|
||||
# Platform initialization
|
||||
# Examples: esp32, esp8266, rp2040
|
||||
|
||||
Reference in New Issue
Block a user