mirror of
https://github.com/esphome/esphome.git
synced 2026-09-01 10:36:01 +00:00
[log] Add ESPHOME_DEBUG_ASSERT for log function invariants
Add ESPHOME_DEBUG_ASSERT macro that only fires when ESPHOME_DEBUG is defined. Use it to assert global_logger is not null in log functions. Enable ESPHOME_DEBUG in C++ unit test builds so these assertions are active during testing but have zero cost in production firmware.
This commit is contained in:
@@ -100,6 +100,7 @@ def create_test_config(config_name: str, includes: list[str]) -> dict:
|
||||
"build_flags": [
|
||||
"-Og", # optimize for debug
|
||||
"-DUSE_TIME_TIMEZONE", # enable timezone code paths for testing
|
||||
"-DESPHOME_DEBUG", # enable debug assertions
|
||||
],
|
||||
"debug_build_flags": [ # only for debug builds
|
||||
"-g3", # max debug info
|
||||
|
||||
Reference in New Issue
Block a user