mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Better internal debugging
This commit is contained in:
		| @@ -74,9 +74,27 @@ def required_build_flags(config): | |||||||
|         flags.append(u'-DESPHOMELIB_LOG_LEVEL={}'.format(str(LOG_LEVELS[config[CONF_LEVEL]]))) |         flags.append(u'-DESPHOMELIB_LOG_LEVEL={}'.format(str(LOG_LEVELS[config[CONF_LEVEL]]))) | ||||||
|         this_severity = LOG_LEVEL_SEVERITY.index(config[CONF_LEVEL]) |         this_severity = LOG_LEVEL_SEVERITY.index(config[CONF_LEVEL]) | ||||||
|         verbose_severity = LOG_LEVEL_SEVERITY.index('VERBOSE') |         verbose_severity = LOG_LEVEL_SEVERITY.index('VERBOSE') | ||||||
|         if CORE.is_esp8266 and config.get(CONF_BAUD_RATE) != 0 and \ |         is_at_least_verbose = this_severity >= verbose_severity | ||||||
|                 this_severity >= verbose_severity: |         has_serial_logging = config.get(CONF_BAUD_RATE) != 0 | ||||||
|  |         if CORE.is_esp8266 and has_serial_logging and is_at_least_verbose: | ||||||
|             flags.append(u"-DDEBUG_ESP_PORT=Serial") |             flags.append(u"-DDEBUG_ESP_PORT=Serial") | ||||||
|  |             DEBUG_COMPONENTS = { | ||||||
|  |                 'CORE', | ||||||
|  |                 'HTTP_CLIENT', | ||||||
|  |                 'HTTP_SERVER', | ||||||
|  |                 'HTTP_UPDATE', | ||||||
|  |                 'OOM', | ||||||
|  |                 'OTA', | ||||||
|  |                 'SSL', | ||||||
|  |                 'TLS_MEM', | ||||||
|  |                 'UPDATER', | ||||||
|  |                 'WIFI', | ||||||
|  |             } | ||||||
|  |             for comp in DEBUG_COMPONENTS: | ||||||
|  |                 flags.append(u"-DDEBUG_ESP_{}".format(comp)) | ||||||
|  |         if CORE.is_esp32 and is_at_least_verbose: | ||||||
|  |             flags.append('-DCORE_DEBUG_LEVEL=5') | ||||||
|  |  | ||||||
|     return flags |     return flags | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user