mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 11:07:33 +00:00
esp32-preferences-defer-init-log
ESP32Preferences::open() runs from app_main() before the generated setup() calls Logger::pre_setup(), so global_logger is null. The ESP_LOGW on nvs_open failure would dereference null in release builds (and assert in ESPHOME_DEBUG). Stash the err in a static and emit the warning lazily from the first make_preference() call, which runs after pre_setup() at EARLY_INIT priority.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
393 MiB
Languages
C++
60.7%
Python
38.9%
C
0.3%
