[core] Fix multiline log continuations without leading whitespace (#14217)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jonathan Swoboda
2026-02-23 00:08:40 -05:00
committed by GitHub
parent 417f4535af
commit fb6c7d81d5
50 changed files with 291 additions and 345 deletions

View File

@@ -92,10 +92,7 @@ void AbsoluteHumidityComponent::loop() {
// Calculate absolute humidity
const float absolute_humidity = vapor_density(es, hr, temperature_k);
ESP_LOGD(TAG,
"Saturation vapor pressure %f kPa\n"
"Publishing absolute humidity %f g/m³",
es, absolute_humidity);
ESP_LOGD(TAG, "Saturation vapor pressure %f kPa, absolute humidity %f g/m³", es, absolute_humidity);
// Publish absolute humidity
this->status_clear_warning();

View File

@@ -67,10 +67,8 @@ void Anova::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_
case ESP_GATTC_SEARCH_CMPL_EVT: {
auto *chr = this->parent_->get_characteristic(ANOVA_SERVICE_UUID, ANOVA_CHARACTERISTIC_UUID);
if (chr == nullptr) {
ESP_LOGW(TAG,
"[%s] No control service found at device, not an Anova..?\n"
"[%s] Note, this component does not currently support Anova Nano.",
this->get_name().c_str(), this->get_name().c_str());
ESP_LOGW(TAG, "[%s] No control service found at device, not an Anova..?", this->get_name().c_str());
ESP_LOGW(TAG, "[%s] Note, this component does not currently support Anova Nano.", this->get_name().c_str());
break;
}
this->char_handle_ = chr->handle;

View File

@@ -307,9 +307,9 @@ void AS3935Component::tune_antenna() {
uint8_t tune_val = this->read_capacitance();
ESP_LOGI(TAG,
"Starting antenna tuning\n"
"Division Ratio is set to: %d\n"
"Internal Capacitor is set to: %d\n"
"Displaying oscillator on INT pin. Measure its frequency - multiply value by Division Ratio",
" Division Ratio is set to: %d\n"
" Internal Capacitor is set to: %d\n"
" Displaying oscillator on INT pin. Measure its frequency - multiply value by Division Ratio",
div_ratio, tune_val);
this->display_oscillator(true, ANTFREQ);
}

View File

@@ -77,14 +77,14 @@ void AT581XComponent::dump_config() { LOG_I2C_DEVICE(this); }
bool AT581XComponent::i2c_write_config() {
ESP_LOGCONFIG(TAG,
"Writing new config for AT581X\n"
"Frequency: %dMHz\n"
"Sensing distance: %d\n"
"Power: %dµA\n"
"Gain: %d\n"
"Trigger base time: %dms\n"
"Trigger keep time: %dms\n"
"Protect time: %dms\n"
"Self check time: %dms",
" Frequency: %dMHz\n"
" Sensing distance: %d\n"
" Power: %dµA\n"
" Gain: %d\n"
" Trigger base time: %dms\n"
" Trigger keep time: %dms\n"
" Protect time: %dms\n"
" Self check time: %dms",
this->freq_, this->delta_, this->power_, this->gain_, this->trigger_base_time_ms_,
this->trigger_keep_time_ms_, this->protect_time_ms_, this->self_check_time_ms_);

View File

@@ -29,10 +29,8 @@ void MultiClickTrigger::on_state_(bool state) {
// Start matching
MultiClickTriggerEvent evt = this->timing_[0];
if (evt.state == state) {
ESP_LOGV(TAG,
"START min=%" PRIu32 " max=%" PRIu32 "\n"
"Multi Click: Starting multi click action!",
evt.min_length, evt.max_length);
ESP_LOGV(TAG, "START min=%" PRIu32 " max=%" PRIu32, evt.min_length, evt.max_length);
ESP_LOGV(TAG, "Multi Click: Starting multi click action!");
this->at_index_ = 1;
if (this->timing_.size() == 1 && evt.max_length == 4294967294UL) {
this->set_timeout(MULTICLICK_TRIGGER_ID, evt.min_length, [this]() { this->trigger_(); });

View File

@@ -182,7 +182,10 @@ void BL0940::recalibrate_() {
ESP_LOGD(TAG,
"Recalibrated reference values:\n"
"Voltage: %f\n, Current: %f\n, Power: %f\n, Energy: %f\n",
" Voltage: %f\n"
" Current: %f\n"
" Power: %f\n"
" Energy: %f",
this->voltage_reference_cal_, this->current_reference_cal_, this->power_reference_cal_,
this->energy_reference_cal_);
}

View File

@@ -148,14 +148,14 @@ void CurrentBasedCover::dump_config() {
}
ESP_LOGCONFIG(TAG,
" Close Duration: %.1fs\n"
"Obstacle Rollback: %.1f%%",
" Obstacle Rollback: %.1f%%",
this->close_duration_ / 1e3f, this->obstacle_rollback_ * 100);
if (this->max_duration_ != UINT32_MAX) {
ESP_LOGCONFIG(TAG, "Maximum duration: %.1fs", this->max_duration_ / 1e3f);
ESP_LOGCONFIG(TAG, " Maximum duration: %.1fs", this->max_duration_ / 1e3f);
}
ESP_LOGCONFIG(TAG,
"Start sensing delay: %.1fs\n"
"Malfunction detection: %s",
" Start sensing delay: %.1fs\n"
" Malfunction detection: %s",
this->start_sensing_delay_ / 1e3f, YESNO(this->malfunction_detection_));
}

View File

@@ -79,7 +79,6 @@ const char *DebugComponent::get_reset_reason_(std::span<char, RESET_REASON_BUFFE
} else {
snprintf(buf, size, "unknown source");
}
ESP_LOGD(TAG, "Reset Reason: %s", buf);
return buf;
}
@@ -107,7 +106,6 @@ const char *DebugComponent::get_wakeup_cause_(std::span<char, RESET_REASON_BUFFE
} else {
wake_reason = "unknown source";
}
ESP_LOGD(TAG, "Wakeup Reason: %s", wake_reason);
// Return the static string directly - no need to copy to buffer
return wake_reason;
}
@@ -172,7 +170,6 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
}
uint32_t flash_size = ESP.getFlashChipSize() / 1024; // NOLINT
uint32_t flash_speed = ESP.getFlashChipSpeed() / 1000000; // NOLINT
ESP_LOGD(TAG, "Flash Chip: Size=%" PRIu32 "kB Speed=%" PRIu32 "MHz Mode=%s", flash_size, flash_speed, flash_mode);
pos = buf_append_printf(buf, size, pos, "|Flash: %" PRIu32 "kB Speed:%" PRIu32 "MHz Mode:%s", flash_size, flash_speed,
flash_mode);
#endif
@@ -194,39 +191,46 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
if (info.features != 0) {
pos = buf_append_printf(buf, size, pos, "%sOther:0x%" PRIx32, first_feature ? "" : ", ", info.features);
}
ESP_LOGD(TAG, "Chip: Model=%s, Cores=%u, Revision=%u", model, info.cores, info.revision);
pos = buf_append_printf(buf, size, pos, " Cores:%u Revision:%u", info.cores, info.revision);
uint32_t cpu_freq_mhz = arch_get_cpu_freq_hz() / 1000000;
ESP_LOGD(TAG, "CPU Frequency: %" PRIu32 " MHz", cpu_freq_mhz);
pos = buf_append_printf(buf, size, pos, "|CPU Frequency: %" PRIu32 " MHz", cpu_freq_mhz);
// Framework detection
#ifdef USE_ARDUINO
ESP_LOGD(TAG, "Framework: Arduino");
pos = buf_append_printf(buf, size, pos, "|Framework: Arduino");
#elif defined(USE_ESP32)
ESP_LOGD(TAG, "Framework: ESP-IDF");
pos = buf_append_printf(buf, size, pos, "|Framework: ESP-IDF");
#else
ESP_LOGW(TAG, "Framework: UNKNOWN");
pos = buf_append_printf(buf, size, pos, "|Framework: UNKNOWN");
#endif
ESP_LOGD(TAG, "ESP-IDF Version: %s", esp_get_idf_version());
pos = buf_append_printf(buf, size, pos, "|ESP-IDF: %s", esp_get_idf_version());
uint8_t mac[6];
get_mac_address_raw(mac);
ESP_LOGD(TAG, "EFuse MAC: %02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
pos = buf_append_printf(buf, size, pos, "|EFuse MAC: %02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3],
mac[4], mac[5]);
char reason_buffer[RESET_REASON_BUFFER_SIZE];
const char *reset_reason = get_reset_reason_(std::span<char, RESET_REASON_BUFFER_SIZE>(reason_buffer));
pos = buf_append_printf(buf, size, pos, "|Reset: %s", reset_reason);
const char *wakeup_cause = get_wakeup_cause_(std::span<char, RESET_REASON_BUFFER_SIZE>(reason_buffer));
uint8_t mac[6];
get_mac_address_raw(mac);
ESP_LOGD(TAG,
"ESP32 debug info:\n"
" Chip: %s\n"
" Cores: %u\n"
" Revision: %u\n"
" CPU Frequency: %" PRIu32 " MHz\n"
" ESP-IDF Version: %s\n"
" EFuse MAC: %02X:%02X:%02X:%02X:%02X:%02X\n"
" Reset Reason: %s\n"
" Wakeup Cause: %s",
model, info.cores, info.revision, cpu_freq_mhz, esp_get_idf_version(), mac[0], mac[1], mac[2], mac[3],
mac[4], mac[5], reset_reason, wakeup_cause);
#if defined(USE_ARDUINO)
ESP_LOGD(TAG, " Flash: Size=%" PRIu32 "kB Speed=%" PRIu32 "MHz Mode=%s", flash_size, flash_speed, flash_mode);
#endif
// Framework detection
#ifdef USE_ARDUINO
ESP_LOGD(TAG, " Framework: Arduino");
pos = buf_append_printf(buf, size, pos, "|Framework: Arduino");
#else
ESP_LOGD(TAG, " Framework: ESP-IDF");
pos = buf_append_printf(buf, size, pos, "|Framework: ESP-IDF");
#endif
pos = buf_append_printf(buf, size, pos, "|ESP-IDF: %s", esp_get_idf_version());
pos = buf_append_printf(buf, size, pos, "|EFuse MAC: %02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3],
mac[4], mac[5]);
pos = buf_append_printf(buf, size, pos, "|Reset: %s", reset_reason);
pos = buf_append_printf(buf, size, pos, "|Wakeup: %s", wakeup_cause);
return pos;

View File

@@ -128,14 +128,16 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
// NOLINTEND(readability-static-accessed-through-instance)
ESP_LOGD(TAG,
"Chip ID: 0x%08" PRIX32 "\n"
"SDK Version: %s\n"
"Core Version: %s\n"
"Boot Version=%u Mode=%u\n"
"CPU Frequency: %u\n"
"Flash Chip ID=0x%08" PRIX32 "\n"
"Reset Reason: %s\n"
"Reset Info: %s",
"ESP8266 debug info:\n"
" Chip ID: 0x%08" PRIX32 "\n"
" SDK Version: %s\n"
" Core Version: %s\n"
" Boot Version: %u\n"
" Boot Mode: %u\n"
" CPU Frequency: %u\n"
" Flash Chip ID: 0x%08" PRIX32 "\n"
" Reset Reason: %s\n"
" Reset Info: %s",
chip_id, sdk_version, get_core_version_str(core_version_buffer), boot_version, boot_mode, cpu_freq,
flash_chip_id, reset_reason, get_reset_info_str(reset_info_buffer, resetInfo.reason));

View File

@@ -27,12 +27,14 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
uint32_t mac_id = lt_cpu_get_mac_id();
ESP_LOGD(TAG,
"LibreTiny Version: %s\n"
"Chip: %s (%04x) @ %u MHz\n"
"Chip ID: 0x%06" PRIX32 "\n"
"Board: %s\n"
"Flash: %" PRIu32 " KiB / RAM: %" PRIu32 " KiB\n"
"Reset Reason: %s",
"LibreTiny debug info:\n"
" Version: %s\n"
" Chip: %s (%04x) @ %u MHz\n"
" Chip ID: 0x%06" PRIX32 "\n"
" Board: %s\n"
" Flash: %" PRIu32 " KiB\n"
" RAM: %" PRIu32 " KiB\n"
" Reset Reason: %s",
lt_get_version(), lt_cpu_get_model_name(), lt_cpu_get_model(), lt_cpu_get_freq_mhz(), mac_id,
lt_get_board_code(), flash_kib, ram_kib, reset_reason);

View File

@@ -79,13 +79,13 @@ static void fa_cb(const struct flash_area *fa, void *user_data) {
void DebugComponent::log_partition_info_() {
#if CONFIG_FLASH_MAP_LABELS
ESP_LOGCONFIG(TAG, "ID | Device | Device Name "
"| Label | Offset | Size\n"
"--------------------------------------------"
"| Label | Offset | Size");
ESP_LOGCONFIG(TAG, "--------------------------------------------"
"-----------------------------------------------");
#else
ESP_LOGCONFIG(TAG, "ID | Device | Device Name "
"| Offset | Size\n"
"-----------------------------------------"
"| Offset | Size");
ESP_LOGCONFIG(TAG, "-----------------------------------------"
"------------------------------");
#endif
flash_area_foreach(fa_cb, nullptr);
@@ -284,11 +284,12 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
char mac_pretty[MAC_ADDRESS_PRETTY_BUFFER_SIZE];
get_mac_address_pretty_into_buffer(mac_pretty);
ESP_LOGD(TAG,
"Code page size: %u, code size: %u, device id: 0x%08x%08x\n"
"Encryption root: 0x%08x%08x%08x%08x, Identity Root: 0x%08x%08x%08x%08x\n"
"Device address type: %s, address: %s\n"
"Part code: nRF%x, version: %c%c%c%c, package: %s\n"
"RAM: %ukB, Flash: %ukB, production test: %sdone",
"nRF debug info:\n"
" Code page size: %u, code size: %u, device id: 0x%08x%08x\n"
" Encryption root: 0x%08x%08x%08x%08x, Identity Root: 0x%08x%08x%08x%08x\n"
" Device address type: %s, address: %s\n"
" Part code: nRF%x, version: %c%c%c%c, package: %s\n"
" RAM: %ukB, Flash: %ukB, production test: %sdone",
NRF_FICR->CODEPAGESIZE, NRF_FICR->CODESIZE, NRF_FICR->DEVICEID[1], NRF_FICR->DEVICEID[0], NRF_FICR->ER[0],
NRF_FICR->ER[1], NRF_FICR->ER[2], NRF_FICR->ER[3], NRF_FICR->IR[0], NRF_FICR->IR[1], NRF_FICR->IR[2],
NRF_FICR->IR[3], (NRF_FICR->DEVICEADDRTYPE & 0x1 ? "Random" : "Public"), mac_pretty, NRF_FICR->INFO.PART,
@@ -299,23 +300,22 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
(NRF_UICR->PSELRESET[0] & UICR_PSELRESET_CONNECT_Msk) == UICR_PSELRESET_CONNECT_Connected
<< UICR_PSELRESET_CONNECT_Pos;
ESP_LOGD(
TAG, "GPIO as NFC pins: %s, GPIO as nRESET pin: %s",
TAG, " GPIO as NFC pins: %s, GPIO as nRESET pin: %s",
YESNO((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)),
YESNO(n_reset_enabled));
if (n_reset_enabled) {
uint8_t port = (NRF_UICR->PSELRESET[0] & UICR_PSELRESET_PORT_Msk) >> UICR_PSELRESET_PORT_Pos;
uint8_t pin = (NRF_UICR->PSELRESET[0] & UICR_PSELRESET_PIN_Msk) >> UICR_PSELRESET_PIN_Pos;
ESP_LOGD(TAG, "nRESET port P%u.%02u", port, pin);
ESP_LOGD(TAG, " nRESET port P%u.%02u", port, pin);
}
#ifdef USE_BOOTLOADER_MCUBOOT
ESP_LOGD(TAG, "bootloader: mcuboot");
ESP_LOGD(TAG, " Bootloader: mcuboot");
#else
ESP_LOGD(TAG, "bootloader: Adafruit, version %u.%u.%u", (BOOTLOADER_VERSION_REGISTER >> 16) & 0xFF,
ESP_LOGD(TAG, " Bootloader: Adafruit, version %u.%u.%u", (BOOTLOADER_VERSION_REGISTER >> 16) & 0xFF,
(BOOTLOADER_VERSION_REGISTER >> 8) & 0xFF, BOOTLOADER_VERSION_REGISTER & 0xFF);
ESP_LOGD(TAG,
"MBR bootloader addr 0x%08x, UICR bootloader addr 0x%08x\n"
"MBR param page addr 0x%08x, UICR param page addr 0x%08x",
read_mem_u32(MBR_BOOTLOADER_ADDR), NRF_UICR->NRFFW[0], read_mem_u32(MBR_PARAM_PAGE_ADDR),
ESP_LOGD(TAG, " MBR bootloader addr 0x%08x, UICR bootloader addr 0x%08x", read_mem_u32(MBR_BOOTLOADER_ADDR),
NRF_UICR->NRFFW[0]);
ESP_LOGD(TAG, " MBR param page addr 0x%08x, UICR param page addr 0x%08x", read_mem_u32(MBR_PARAM_PAGE_ADDR),
NRF_UICR->NRFFW[1]);
if (is_sd_present()) {
uint32_t const sd_id = sd_id_get();
@@ -326,7 +326,7 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
ver[1] = (sd_version - ver[0] * 1000000) / 1000;
ver[2] = (sd_version - ver[0] * 1000000 - ver[1] * 1000);
ESP_LOGD(TAG, "SoftDevice: S%u %u.%u.%u", sd_id, ver[0], ver[1], ver[2]);
ESP_LOGD(TAG, " SoftDevice: S%u %u.%u.%u", sd_id, ver[0], ver[1], ver[2]);
#ifdef USE_SOFTDEVICE_ID
#ifdef USE_SOFTDEVICE_VERSION
if (USE_SOFTDEVICE_ID != sd_id || USE_SOFTDEVICE_VERSION != ver[0]) {
@@ -352,10 +352,8 @@ size_t DebugComponent::get_device_info_(std::span<char, DEVICE_INFO_BUFFER_SIZE>
}
return res;
};
ESP_LOGD(TAG,
"NRFFW %s\n"
"NRFHW %s",
uicr(NRF_UICR->NRFFW, 13).c_str(), uicr(NRF_UICR->NRFHW, 12).c_str());
ESP_LOGD(TAG, " NRFFW %s", uicr(NRF_UICR->NRFFW, 13).c_str());
ESP_LOGD(TAG, " NRFHW %s", uicr(NRF_UICR->NRFHW, 12).c_str());
return pos;
}

View File

@@ -187,18 +187,18 @@ uint8_t DetRangeCfgCommand::on_message(std::string &message) {
} else if (message == "Done") {
ESP_LOGI(TAG,
"Updated detection area config:\n"
"Detection area 1 from %.02fm to %.02fm.",
" Detection area 1 from %.02fm to %.02fm.",
this->min1_, this->max1_);
if (this->min2_ >= 0 && this->max2_ >= 0) {
ESP_LOGI(TAG, "Detection area 2 from %.02fm to %.02fm.", this->min2_, this->max2_);
ESP_LOGI(TAG, " Detection area 2 from %.02fm to %.02fm.", this->min2_, this->max2_);
}
if (this->min3_ >= 0 && this->max3_ >= 0) {
ESP_LOGI(TAG, "Detection area 3 from %.02fm to %.02fm.", this->min3_, this->max3_);
ESP_LOGI(TAG, " Detection area 3 from %.02fm to %.02fm.", this->min3_, this->max3_);
}
if (this->min4_ >= 0 && this->max4_ >= 0) {
ESP_LOGI(TAG, "Detection area 4 from %.02fm to %.02fm.", this->min4_, this->max4_);
ESP_LOGI(TAG, " Detection area 4 from %.02fm to %.02fm.", this->min4_, this->max4_);
}
ESP_LOGD(TAG, "Used command: %s", this->cmd_.c_str());
ESP_LOGD(TAG, " Used command: %s", this->cmd_.c_str());
return 1; // Command done
}
return 0; // Command not done yet.
@@ -222,10 +222,10 @@ uint8_t SetLatencyCommand::on_message(std::string &message) {
} else if (message == "Done") {
ESP_LOGI(TAG,
"Updated output latency config:\n"
"Signal that someone was detected is delayed by %.03f s.\n"
"Signal that nobody is detected anymore is delayed by %.03f s.",
" Signal that someone was detected is delayed by %.03f s.\n"
" Signal that nobody is detected anymore is delayed by %.03f s.",
this->delay_after_detection_, this->delay_after_disappear_);
ESP_LOGD(TAG, "Used command: %s", this->cmd_.c_str());
ESP_LOGD(TAG, " Used command: %s", this->cmd_.c_str());
return 1; // Command done
}
return 0; // Command not done yet

View File

@@ -153,10 +153,7 @@ void EmmetiClimate::reverse_add_(T val, size_t len, esphome::remote_base::Remote
bool EmmetiClimate::check_checksum_(uint8_t checksum) {
uint8_t expected = this->gen_checksum_();
ESP_LOGV(TAG,
"Expected checksum: %X\n"
"Checksum received: %X",
expected, checksum);
ESP_LOGV(TAG, "Expected checksum: %X, Checksum received: %X", expected, checksum);
return checksum == expected;
}
@@ -266,10 +263,7 @@ bool EmmetiClimate::on_receive(remote_base::RemoteReceiveData data) {
}
}
ESP_LOGD(TAG,
"Swing: %d\n"
"Sleep: %d",
(curr_state.bitmap >> 1) & 0x01, (curr_state.bitmap >> 2) & 0x01);
ESP_LOGD(TAG, "Swing: %d, Sleep: %d", (curr_state.bitmap >> 1) & 0x01, (curr_state.bitmap >> 2) & 0x01);
for (size_t pos = 0; pos < 4; pos++) {
if (data.expect_item(EMMETI_BIT_MARK, EMMETI_ONE_SPACE)) {
@@ -295,13 +289,8 @@ bool EmmetiClimate::on_receive(remote_base::RemoteReceiveData data) {
}
}
ESP_LOGD(TAG,
"Turbo: %d\n"
"Light: %d\n"
"Tree: %d\n"
"Blow: %d",
(curr_state.bitmap >> 3) & 0x01, (curr_state.bitmap >> 4) & 0x01, (curr_state.bitmap >> 5) & 0x01,
(curr_state.bitmap >> 6) & 0x01);
ESP_LOGD(TAG, "Turbo: %d, Light: %d, Tree: %d, Blow: %d", (curr_state.bitmap >> 3) & 0x01,
(curr_state.bitmap >> 4) & 0x01, (curr_state.bitmap >> 5) & 0x01, (curr_state.bitmap >> 6) & 0x01);
uint16_t control_data = 0;
for (size_t pos = 0; pos < 11; pos++) {

View File

@@ -152,12 +152,13 @@ void ENS160Component::update() {
// verbose status logging
ESP_LOGV(TAG,
"Status: ENS160 STATAS bit 0x%x\n"
"Status: ENS160 STATER bit 0x%x\n"
"Status: ENS160 VALIDITY FLAG 0x%02x\n"
"Status: ENS160 NEWDAT bit 0x%x\n"
"Status: ENS160 NEWGPR bit 0x%x",
(ENS160_DATA_STATUS_STATAS & (status_value)) == ENS160_DATA_STATUS_STATAS,
"ENS160 Status Register: 0x%02x\n"
" STATAS bit 0x%x\n"
" STATER bit 0x%x\n"
" VALIDITY FLAG 0x%02x\n"
" NEWDAT bit 0x%x\n"
" NEWGPR bit 0x%x",
status_value, (ENS160_DATA_STATUS_STATAS & (status_value)) == ENS160_DATA_STATUS_STATAS,
(ENS160_DATA_STATUS_STATER & (status_value)) == ENS160_DATA_STATUS_STATER,
(ENS160_DATA_STATUS_VALIDITY & status_value) >> 2,
(ENS160_DATA_STATUS_NEWDAT & (status_value)) == ENS160_DATA_STATUS_NEWDAT,

View File

@@ -209,9 +209,10 @@ bool ES8388::set_dac_output(DacOutputLine line) {
};
ESP_LOGV(TAG,
"Setting ES8388_DACPOWER to 0x%02X\n"
"Setting ES8388_DACCONTROL24 / ES8388_DACCONTROL25 to 0x%02X\n"
"Setting ES8388_DACCONTROL26 / ES8388_DACCONTROL27 to 0x%02X",
"DAC output config:\n"
" DACPOWER: 0x%02X\n"
" DACCONTROL24/25: 0x%02X\n"
" DACCONTROL26/27: 0x%02X",
dac_power, reg_out1, reg_out2);
ES8388_ERROR_CHECK(this->write_byte(ES8388_DACCONTROL24, reg_out1)); // LOUT1VOL

View File

@@ -423,10 +423,8 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_
for (auto &svc : this->services_) {
char uuid_buf[espbt::UUID_STR_LEN];
svc->uuid.to_str(uuid_buf);
ESP_LOGV(TAG,
"[%d] [%s] Service UUID: %s\n"
"[%d] [%s] start_handle: 0x%x end_handle: 0x%x",
this->connection_index_, this->address_str_, uuid_buf, this->connection_index_, this->address_str_,
ESP_LOGV(TAG, "[%d] [%s] Service UUID: %s", this->connection_index_, this->address_str_, uuid_buf);
ESP_LOGV(TAG, "[%d] [%s] start_handle: 0x%x end_handle: 0x%x", this->connection_index_, this->address_str_,
svc->start_handle, svc->end_handle);
}
#endif

View File

@@ -106,11 +106,12 @@ void Esp32HostedUpdate::setup() {
esp_app_desc_t *app_desc = (esp_app_desc_t *) (this->firmware_data_ + app_desc_offset);
if (app_desc->magic_word == ESP_APP_DESC_MAGIC_WORD) {
ESP_LOGD(TAG,
"Firmware version: %s\n"
"Project name: %s\n"
"Build date: %s\n"
"Build time: %s\n"
"IDF version: %s",
"ESP32 Hosted firmware:\n"
" Firmware version: %s\n"
" Project name: %s\n"
" Build date: %s\n"
" Build time: %s\n"
" IDF version: %s",
app_desc->version, app_desc->project_name, app_desc->date, app_desc->time, app_desc->idf_ver);
this->update_info_.latest_version = app_desc->version;
if (this->update_info_.latest_version != this->update_info_.current_version) {

View File

@@ -21,11 +21,9 @@ void ESPNowTransport::setup() {
return;
}
ESP_LOGI(TAG,
"Registering ESP-NOW handlers\n"
"Peer address: %02X:%02X:%02X:%02X:%02X:%02X",
this->peer_address_[0], this->peer_address_[1], this->peer_address_[2], this->peer_address_[3],
this->peer_address_[4], this->peer_address_[5]);
ESP_LOGI(TAG, "Registering ESP-NOW handlers, peer: %02X:%02X:%02X:%02X:%02X:%02X", this->peer_address_[0],
this->peer_address_[1], this->peer_address_[2], this->peer_address_[3], this->peer_address_[4],
this->peer_address_[5]);
// Register received handler
this->parent_->register_received_handler(this);

View File

@@ -866,10 +866,7 @@ void EthernetComponent::write_phy_register_(esp_eth_mac_t *mac, PHYRegister regi
}
#endif
ESP_LOGD(TAG,
"Writing to PHY Register Address: 0x%02" PRIX32 "\n"
"Writing to PHY Register Value: 0x%04" PRIX32,
register_data.address, register_data.value);
ESP_LOGD(TAG, "Writing PHY reg 0x%02" PRIX32 " = 0x%04" PRIX32, register_data.address, register_data.value);
err = mac->write_phy_reg(mac, this->phy_addr_, register_data.address, register_data.value);
ESPHL_ERROR_CHECK(err, "Writing PHY Register failed");

View File

@@ -150,9 +150,9 @@ void EzoPMP::read_command_result_() {
if (current_char == '\0') {
ESP_LOGV(TAG,
"Read Response from device: %s\n"
"First Component: %s\n"
"Second Component: %s\n"
"Third Component: %s",
" First Component: %s\n"
" Second Component: %s\n"
" Third Component: %s",
(char *) response_buffer, (char *) first_parameter_buffer, (char *) second_parameter_buffer,
(char *) third_parameter_buffer);

View File

@@ -97,10 +97,10 @@ void GCJA5Component::parse_data_() {
ESP_LOGI(TAG,
"GCJA5 Status\n"
"Overall Status : %i\n"
"PD Status : %i\n"
"LD Status : %i\n"
"Fan Status : %i",
" Overall Status : %i\n"
" PD Status : %i\n"
" LD Status : %i\n"
" Fan Status : %i",
(status >> 6) & 0x03, (status >> 4) & 0x03, (status >> 2) & 0x03, (status >> 0) & 0x03);
}
}

View File

@@ -38,13 +38,13 @@ void GraphicalDisplayMenu::setup() {
void GraphicalDisplayMenu::dump_config() {
ESP_LOGCONFIG(TAG,
"Graphical Display Menu\n"
"Has Display: %s\n"
"Popup Mode: %s\n"
"Advanced Drawing Mode: %s\n"
"Has Font: %s\n"
"Mode: %s\n"
"Active: %s\n"
"Menu items:",
" Has Display: %s\n"
" Popup Mode: %s\n"
" Advanced Drawing Mode: %s\n"
" Has Font: %s\n"
" Mode: %s\n"
" Active: %s\n"
" Menu items:",
YESNO(this->display_ != nullptr), YESNO(this->display_ != nullptr), YESNO(this->display_ == nullptr),
YESNO(this->font_ != nullptr),
this->mode_ == display_menu_base::MENU_MODE_ROTARY ? "Rotary" : "Joystick", YESNO(this->active_));

View File

@@ -35,10 +35,7 @@ uint8_t HONEYWELLABPSensor::readsensor_() {
pressure_count_ = ((uint16_t) (buf_[0]) << 8 & 0x3F00) | ((uint16_t) (buf_[1]) & 0xFF);
// 11 - bit temperature is all of byte 2 (lowest 8 bits) and the first three bits of byte 3
temperature_count_ = (((uint16_t) (buf_[2]) << 3) & 0x7F8) | (((uint16_t) (buf_[3]) >> 5) & 0x7);
ESP_LOGV(TAG,
"Sensor pressure_count_ %d\n"
"Sensor temperature_count_ %d",
pressure_count_, temperature_count_);
ESP_LOGV(TAG, "Sensor pressure_count_ %d, temperature_count_ %d", pressure_count_, temperature_count_);
}
return status_;
}

View File

@@ -105,8 +105,7 @@ uint8_t OtaHttpRequestComponent::do_ota_() {
// we will compute MD5 on the fly for verification -- Arduino OTA seems to ignore it
md5_receive.init();
ESP_LOGV(TAG, "MD5Digest initialized\n"
"OTA backend begin");
ESP_LOGV(TAG, "MD5Digest initialized, OTA backend begin");
auto backend = ota::make_ota_backend();
auto error_code = backend->begin(container->content_length);
if (error_code != ota::OTA_RESPONSE_OK) {

View File

@@ -362,10 +362,8 @@ bool INA2XX::configure_shunt_() {
ESP_LOGW(TAG, "Shunt value too high");
}
this->shunt_cal_ &= 0x7FFF;
ESP_LOGV(TAG,
"Given Rshunt=%f Ohm and Max_current=%.3f\n"
"New CURRENT_LSB=%f, SHUNT_CAL=%u",
this->shunt_resistance_ohm_, this->max_current_a_, this->current_lsb_, this->shunt_cal_);
ESP_LOGV(TAG, "Rshunt=%f Ohm, max current=%.3f A, current LSB=%f, shunt cal=%u", this->shunt_resistance_ohm_,
this->max_current_a_, this->current_lsb_, this->shunt_cal_);
return this->write_unsigned_16_(RegisterMap::REG_SHUNT_CAL, this->shunt_cal_);
}

View File

@@ -489,11 +489,8 @@ bool LD2410Component::handle_ack_data_() {
this->out_pin_level_ = this->buffer_data_[12];
const auto *light_function_str = find_str(LIGHT_FUNCTIONS_BY_UINT, this->light_function_);
const auto *out_pin_level_str = find_str(OUT_PIN_LEVELS_BY_UINT, this->out_pin_level_);
ESP_LOGV(TAG,
"Light function: %s\n"
"Light threshold: %u\n"
"Out pin level: %s",
light_function_str, this->light_threshold_, out_pin_level_str);
ESP_LOGV(TAG, "Light function: %s, threshold: %u, out pin level: %s", light_function_str, this->light_threshold_,
out_pin_level_str);
#ifdef USE_SELECT
if (this->light_function_select_ != nullptr) {
this->light_function_select_->publish_state(light_function_str);

View File

@@ -530,10 +530,7 @@ bool LD2412Component::handle_ack_data_() {
this->light_function_ = this->buffer_data_[10];
this->light_threshold_ = this->buffer_data_[11];
const auto *light_function_str = find_str(LIGHT_FUNCTIONS_BY_UINT, this->light_function_);
ESP_LOGV(TAG,
"Light function: %s\n"
"Light threshold: %u",
light_function_str, this->light_threshold_);
ESP_LOGV(TAG, "Light function: %s, threshold: %u", light_function_str, this->light_threshold_);
#ifdef USE_SELECT
if (this->light_function_select_ != nullptr) {
this->light_function_select_->publish_state(light_function_str);

View File

@@ -130,10 +130,8 @@ void LEDCOutput::setup() {
}
int hpoint = ledc_angle_to_htop(this->phase_angle_, this->bit_depth_);
ESP_LOGV(TAG,
"Configured frequency %f with a bit depth of %u bits\n"
"Angle of %.1f° results in hpoint %u",
this->frequency_, this->bit_depth_, this->phase_angle_, hpoint);
ESP_LOGV(TAG, "Configured frequency %f with bit depth %u, angle %.1f° hpoint %u", this->frequency_, this->bit_depth_,
this->phase_angle_, hpoint);
ledc_channel_config_t chan_conf{};
chan_conf.gpio_num = this->pin_->get_pin();

View File

@@ -146,11 +146,11 @@ void MAX6956::dump_config() {
if (brightness_mode_ == MAX6956CURRENTMODE::GLOBAL) {
ESP_LOGCONFIG(TAG,
"current mode: global\n"
"global brightness: %u",
" Current mode: global\n"
" Brightness: %u",
global_brightness_);
} else {
ESP_LOGCONFIG(TAG, "current mode: segment");
ESP_LOGCONFIG(TAG, " Current mode: segment");
}
}

View File

@@ -165,10 +165,7 @@ void MQTTBackendESP32::mqtt_event_handler_(const Event &event) {
case MQTT_EVENT_ERROR:
ESP_LOGE(TAG, "MQTT_EVENT_ERROR");
if (event.error_handle.error_type == MQTT_ERROR_TYPE_TCP_TRANSPORT) {
ESP_LOGE(TAG,
"Last error code reported from esp-tls: 0x%x\n"
"Last tls stack error number: 0x%x\n"
"Last captured errno : %d (%s)",
ESP_LOGE(TAG, "Last esp-tls error: 0x%x, tls stack error: 0x%x, socket errno: %d (%s)",
event.error_handle.esp_tls_last_esp_err, event.error_handle.esp_tls_stack_err,
event.error_handle.esp_transport_sock_errno, strerror(event.error_handle.esp_transport_sock_errno));
} else if (event.error_handle.error_type == MQTT_ERROR_TYPE_CONNECTION_REFUSED) {

View File

@@ -25,11 +25,7 @@ int Nextion::upload_by_chunks_(HTTPClient &http_client, uint32_t &range_start) {
uint32_t range_end = ((upload_first_chunk_sent_ or this->tft_size_ < 4096) ? this->tft_size_ : 4096) - 1;
ESP_LOGD(TAG, "Range start: %" PRIu32, range_start);
if (range_size <= 0 or range_end <= range_start) {
ESP_LOGE(TAG, "Invalid range");
ESP_LOGD(TAG,
"Range end: %" PRIu32 "\n"
"Range size: %" PRIu32,
range_end, range_size);
ESP_LOGE(TAG, "Invalid range end: %" PRIu32 ", size: %" PRIu32, range_end, range_size);
return -1;
}
@@ -138,11 +134,7 @@ int Nextion::upload_by_chunks_(HTTPClient &http_client, uint32_t &range_start) {
}
bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
ESP_LOGD(TAG,
"TFT upload requested\n"
"Exit reparse: %s\n"
"URL: %s",
YESNO(exit_reparse), this->tft_url_.c_str());
ESP_LOGD(TAG, "TFT upload requested, exit reparse: %s, URL: %s", YESNO(exit_reparse), this->tft_url_.c_str());
if (this->connection_state_.is_updating_) {
ESP_LOGW(TAG, "Upload in progress");
@@ -172,10 +164,7 @@ bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
ESP_LOGD(TAG, "Baud rate: %" PRIu32, baud_rate);
// Define the configuration for the HTTP client
ESP_LOGV(TAG,
"Init HTTP client\n"
"Heap: %" PRIu32,
EspClass::getFreeHeap());
ESP_LOGV(TAG, "Init HTTP client, heap: %" PRIu32, EspClass::getFreeHeap());
HTTPClient http_client;
http_client.setTimeout(15000); // Yes 15 seconds.... Helps 8266s along
@@ -262,10 +251,7 @@ bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
this->reset_(false);
delay(250); // NOLINT
ESP_LOGV(TAG,
"Heap: %" PRIu32 "\n"
"Upload cmd: %s",
EspClass::getFreeHeap(), command);
ESP_LOGV(TAG, "Heap: %" PRIu32 ", upload cmd: %s", EspClass::getFreeHeap(), command);
this->send_command_(command);
if (baud_rate != this->original_baud_rate_) {

View File

@@ -27,11 +27,7 @@ int Nextion::upload_by_chunks_(esp_http_client_handle_t http_client, uint32_t &r
uint32_t range_end = ((upload_first_chunk_sent_ or this->tft_size_ < 4096) ? this->tft_size_ : 4096) - 1;
ESP_LOGD(TAG, "Range start: %" PRIu32, range_start);
if (range_size <= 0 or range_end <= range_start) {
ESP_LOGD(TAG,
"Range end: %" PRIu32 "\n"
"Range size: %" PRIu32,
range_end, range_size);
ESP_LOGE(TAG, "Invalid range");
ESP_LOGE(TAG, "Invalid range end: %" PRIu32 ", size: %" PRIu32, range_end, range_size);
return -1;
}
@@ -159,11 +155,7 @@ int Nextion::upload_by_chunks_(esp_http_client_handle_t http_client, uint32_t &r
}
bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
ESP_LOGD(TAG,
"TFT upload requested\n"
"Exit reparse: %s\n"
"URL: %s",
YESNO(exit_reparse), this->tft_url_.c_str());
ESP_LOGD(TAG, "TFT upload requested, exit reparse: %s, URL: %s", YESNO(exit_reparse), this->tft_url_.c_str());
if (this->connection_state_.is_updating_) {
ESP_LOGW(TAG, "Upload in progress");
@@ -193,10 +185,7 @@ bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
ESP_LOGD(TAG, "Baud rate: %" PRIu32, baud_rate);
// Define the configuration for the HTTP client
ESP_LOGV(TAG,
"Init HTTP client\n"
"Heap: %" PRIu32,
esp_get_free_heap_size());
ESP_LOGV(TAG, "Init HTTP client, heap: %" PRIu32, esp_get_free_heap_size());
esp_http_client_config_t config = {
.url = this->tft_url_.c_str(),
.cert_pem = nullptr,
@@ -220,10 +209,7 @@ bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
}
// Perform the HTTP request
ESP_LOGV(TAG,
"Check connection\n"
"Heap: %" PRIu32,
esp_get_free_heap_size());
ESP_LOGV(TAG, "Check connection, heap: %" PRIu32, esp_get_free_heap_size());
err = esp_http_client_perform(http_client);
if (err != ESP_OK) {
ESP_LOGE(TAG, "HTTP failed: %s", esp_err_to_name(err));
@@ -232,10 +218,7 @@ bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
}
// Check the HTTP Status Code
ESP_LOGV(TAG,
"Check status\n"
"Heap: %" PRIu32,
esp_get_free_heap_size());
ESP_LOGV(TAG, "Check status, heap: %" PRIu32, esp_get_free_heap_size());
int status_code = esp_http_client_get_status_code(http_client);
if (status_code != 200 && status_code != 206) {
ESP_LOGE(TAG, "HTTP request failed with status %d", status_code);
@@ -344,8 +327,7 @@ bool Nextion::upload_tft(uint32_t baud_rate, bool exit_reparse) {
ESP_LOGV(TAG, "Heap: %" PRIu32 " left: %" PRIu32, esp_get_free_heap_size(), this->content_length_);
}
ESP_LOGD(TAG, "TFT upload complete\n"
"Close HTTP");
ESP_LOGD(TAG, "TFT upload complete, closing HTTP");
esp_http_client_close(http_client);
esp_http_client_cleanup(http_client);
ESP_LOGV(TAG, "Connection closed");

View File

@@ -130,10 +130,7 @@ void OpenThreadComponent::ot_main() {
}
#ifdef ESPHOME_LOG_HAS_DEBUG // Fetch link mode from OT only when DEBUG
link_mode_config = otThreadGetLinkMode(instance);
ESP_LOGD(TAG,
"Link Mode Device Type: %s\n"
"Link Mode Network Data: %s\n"
"Link Mode RX On When Idle: %s",
ESP_LOGD(TAG, "Link Mode Device Type: %s, Network Data: %s, RX On When Idle: %s",
TRUEFALSE(link_mode_config.mDeviceType), TRUEFALSE(link_mode_config.mNetworkData),
TRUEFALSE(link_mode_config.mRxOnWhenIdle));
#endif
@@ -152,8 +149,7 @@ void OpenThreadComponent::ot_main() {
// Make sure the length is 0 so we fallback to the configuration
dataset.mLength = 0;
} else {
ESP_LOGI(TAG, "Found OpenThread-managed dataset, ignoring esphome configuration\n"
"(set force_dataset: true to override)");
ESP_LOGI(TAG, "Found existing dataset, ignoring config (force_dataset: true to override)");
}
#endif

View File

@@ -144,9 +144,10 @@ bool PI4IOE5V6408Component::write_gpio_modes_() {
}
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
ESP_LOGV(TAG,
"Wrote GPIO modes: 0b" BYTE_TO_BINARY_PATTERN "\n"
"Wrote GPIO pullup/pulldown: 0b" BYTE_TO_BINARY_PATTERN "\n"
"Wrote GPIO pull enable: 0b" BYTE_TO_BINARY_PATTERN,
"Wrote GPIO config:\n"
" modes: 0b" BYTE_TO_BINARY_PATTERN "\n"
" pullup/pulldown: 0b" BYTE_TO_BINARY_PATTERN "\n"
" pull enable: 0b" BYTE_TO_BINARY_PATTERN,
BYTE_TO_BINARY(this->mode_mask_), BYTE_TO_BINARY(this->pull_up_down_mask_),
BYTE_TO_BINARY(this->pull_enable_mask_));
#endif

View File

@@ -748,8 +748,7 @@ esphome::optional<bool> Pipsolar::get_bit_(std::string bits, uint8_t bit_pos) {
}
void Pipsolar::dump_config() {
ESP_LOGCONFIG(TAG, "Pipsolar:\n"
"enabled polling commands:");
ESP_LOGCONFIG(TAG, "Pipsolar enabled polling commands:");
for (auto &enabled_polling_command : this->enabled_polling_commands_) {
if (enabled_polling_command.length != 0) {
ESP_LOGCONFIG(TAG, "%s", enabled_polling_command.command);

View File

@@ -31,10 +31,7 @@ void PN532::setup() {
this->mark_failed();
return;
}
ESP_LOGD(TAG,
"Found chip PN5%02X\n"
"Firmware ver. %d.%d",
version_data[0], version_data[1], version_data[2]);
ESP_LOGD(TAG, "Found chip PN5%02X, Firmware v%d.%d", version_data[0], version_data[1], version_data[2]);
if (!this->write_command_({
PN532_COMMAND_SAMCONFIGURATION,

View File

@@ -243,9 +243,7 @@ uint8_t PN7150::reset_core_(const bool reset_config, const bool power) {
return nfc::STATUS_FAILED;
}
ESP_LOGD(TAG,
"Configuration %s\n"
"NCI version: %s",
ESP_LOGD(TAG, "Configuration %s, NCI version: %s",
rx.get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 2] ? "reset" : "retained",
rx.get_message()[nfc::NCI_PKT_PAYLOAD_OFFSET + 1] == 0x20 ? "2.0" : "1.0");
@@ -274,11 +272,12 @@ uint8_t PN7150::init_core_() {
uint8_t flash_minor_version = rx.get_message()[19 + rx.get_message()[8]];
ESP_LOGD(TAG,
"Manufacturer ID: 0x%02X\n"
"Hardware version: 0x%02X\n"
"ROM code version: 0x%02X\n"
"FLASH major version: 0x%02X\n"
"FLASH minor version: 0x%02X",
"PN7150 chip info:\n"
" Manufacturer ID: 0x%02X\n"
" Hardware version: 0x%02X\n"
" ROM code version: 0x%02X\n"
" FLASH major version: 0x%02X\n"
" FLASH minor version: 0x%02X",
manf_id, hw_version, rom_code_version, flash_major_version, flash_minor_version);
return rx.get_simple_status_response();

View File

@@ -265,10 +265,7 @@ uint8_t PN7160::reset_core_(const bool reset_config, const bool power) {
return nfc::STATUS_FAILED;
}
ESP_LOGD(TAG,
"Configuration %s\n"
"NCI version: %s\n"
"Manufacturer ID: 0x%02X",
ESP_LOGD(TAG, "Configuration %s, NCI version: %s, Manufacturer ID: 0x%02X",
rx.get_message()[4] ? "reset" : "retained", rx.get_message()[5] == 0x20 ? "2.0" : "1.0",
rx.get_message()[6]);
rx.get_message().erase(rx.get_message().begin(), rx.get_message().begin() + 8);
@@ -301,11 +298,12 @@ uint8_t PN7160::init_core_() {
char feat_buf[nfc::FORMAT_BYTES_BUFFER_SIZE];
ESP_LOGD(TAG,
"Hardware version: %u\n"
"ROM code version: %u\n"
"FLASH major version: %u\n"
"FLASH minor version: %u\n"
"Features: %s",
"PN7160 chip info:\n"
" Hardware version: %u\n"
" ROM code version: %u\n"
" FLASH major version: %u\n"
" FLASH minor version: %u\n"
" Features: %s",
hw_version, rom_code_version, flash_major_version, flash_minor_version,
nfc::format_bytes_to(feat_buf, features));

View File

@@ -128,15 +128,14 @@ bool QMP6988Component::get_calibration_data_() {
qmp6988_data_.qmp6988_cali.COE_bp3 = (int16_t) encode_uint16(a_data_uint8_tr[16], a_data_uint8_tr[17]);
ESP_LOGV(TAG,
"<-----------calibration data-------------->\n"
"COE_a0[%d] COE_a1[%d] COE_a2[%d] COE_b00[%d]",
"Calibration data:\n"
" COE_a0[%d] COE_a1[%d] COE_a2[%d] COE_b00[%d]\n"
" COE_bt1[%d] COE_bt2[%d] COE_bp1[%d] COE_b11[%d]\n"
" COE_bp2[%d] COE_b12[%d] COE_b21[%d] COE_bp3[%d]",
qmp6988_data_.qmp6988_cali.COE_a0, qmp6988_data_.qmp6988_cali.COE_a1, qmp6988_data_.qmp6988_cali.COE_a2,
qmp6988_data_.qmp6988_cali.COE_b00);
ESP_LOGV(TAG, "COE_bt1[%d] COE_bt2[%d] COE_bp1[%d] COE_b11[%d]\r\n", qmp6988_data_.qmp6988_cali.COE_bt1,
qmp6988_data_.qmp6988_cali.COE_bt2, qmp6988_data_.qmp6988_cali.COE_bp1, qmp6988_data_.qmp6988_cali.COE_b11);
ESP_LOGV(TAG, "COE_bp2[%d] COE_b12[%d] COE_b21[%d] COE_bp3[%d]\r\n", qmp6988_data_.qmp6988_cali.COE_bp2,
qmp6988_data_.qmp6988_cali.COE_b00, qmp6988_data_.qmp6988_cali.COE_bt1, qmp6988_data_.qmp6988_cali.COE_bt2,
qmp6988_data_.qmp6988_cali.COE_bp1, qmp6988_data_.qmp6988_cali.COE_b11, qmp6988_data_.qmp6988_cali.COE_bp2,
qmp6988_data_.qmp6988_cali.COE_b12, qmp6988_data_.qmp6988_cali.COE_b21, qmp6988_data_.qmp6988_cali.COE_bp3);
ESP_LOGV(TAG, "<-----------calibration data-------------->\r\n");
qmp6988_data_.ik.a0 = qmp6988_data_.qmp6988_cali.COE_a0; // 20Q4
qmp6988_data_.ik.b00 = qmp6988_data_.qmp6988_cali.COE_b00; // 20Q4
@@ -153,14 +152,13 @@ bool QMP6988Component::get_calibration_data_() {
qmp6988_data_.ik.b21 = 13836L * (int64_t) qmp6988_data_.qmp6988_cali.COE_b21 + 79333336L; // 29Q60
qmp6988_data_.ik.bp3 = 2915L * (int64_t) qmp6988_data_.qmp6988_cali.COE_bp3 + 157155561L; // 28Q65
ESP_LOGV(TAG,
"<----------- int calibration data -------------->\n"
"a0[%d] a1[%d] a2[%d] b00[%d]",
qmp6988_data_.ik.a0, qmp6988_data_.ik.a1, qmp6988_data_.ik.a2, qmp6988_data_.ik.b00);
ESP_LOGV(TAG, "bt1[%lld] bt2[%lld] bp1[%lld] b11[%lld]\r\n", qmp6988_data_.ik.bt1, qmp6988_data_.ik.bt2,
qmp6988_data_.ik.bp1, qmp6988_data_.ik.b11);
ESP_LOGV(TAG, "bp2[%lld] b12[%lld] b21[%lld] bp3[%lld]\r\n", qmp6988_data_.ik.bp2, qmp6988_data_.ik.b12,
"Int calibration data:\n"
" a0[%d] a1[%d] a2[%d] b00[%d]\n"
" bt1[%lld] bt2[%lld] bp1[%lld] b11[%lld]\n"
" bp2[%lld] b12[%lld] b21[%lld] bp3[%lld]",
qmp6988_data_.ik.a0, qmp6988_data_.ik.a1, qmp6988_data_.ik.a2, qmp6988_data_.ik.b00, qmp6988_data_.ik.bt1,
qmp6988_data_.ik.bt2, qmp6988_data_.ik.bp1, qmp6988_data_.ik.b11, qmp6988_data_.ik.bp2, qmp6988_data_.ik.b12,
qmp6988_data_.ik.b21, qmp6988_data_.ik.bp3);
ESP_LOGV(TAG, "<----------- int calibration data -------------->\r\n");
return true;
}

View File

@@ -104,10 +104,7 @@ void ProntoProtocol::send_pronto_(RemoteTransmitData *dst, const std::vector<uin
uint16_t intros = 2 * data[2];
uint16_t repeats = 2 * data[3];
ESP_LOGD(TAG,
"Send Pronto: intros=%d\n"
"Send Pronto: repeats=%d",
intros, repeats);
ESP_LOGD(TAG, "Send Pronto: intros=%d, repeats=%d", intros, repeats);
if (NUMBERS_IN_PREAMBLE + intros + repeats != data.size()) { // inconsistent sizes
ESP_LOGE(TAG, "Inconsistent data, not sending");
return;

View File

@@ -51,13 +51,11 @@ void SafeModeComponent::dump_config() {
#if defined(USE_ESP32) && defined(USE_OTA_ROLLBACK)
const esp_partition_t *last_invalid = esp_ota_get_last_invalid_partition();
if (last_invalid != nullptr) {
ESP_LOGW(TAG,
"OTA rollback detected! Rolled back from partition '%s'\n"
"The device reset before the boot was marked successful",
last_invalid->label);
ESP_LOGW(TAG, "OTA rollback detected! Rolled back from partition '%s'", last_invalid->label);
ESP_LOGW(TAG, "The device reset before the boot was marked successful");
if (esp_reset_reason() == ESP_RST_BROWNOUT) {
ESP_LOGW(TAG, "Last reset was due to brownout - check your power supply!\n"
"See https://esphome.io/guides/faq.html#brownout-detector-was-triggered");
ESP_LOGW(TAG, "Last reset was due to brownout - check your power supply!");
ESP_LOGW(TAG, "See https://esphome.io/guides/faq.html#brownout-detector-was-triggered");
}
}
#endif

View File

@@ -326,7 +326,7 @@ void Sim800LComponent::parse_cmd_(std::string message) {
if (ok || message.compare(0, 6, "+CMGL:") == 0) {
ESP_LOGD(TAG,
"Received SMS from: %s\n"
"%s",
" %s",
this->sender_.c_str(), this->message_.c_str());
this->sms_received_callback_.call(this->message_, this->sender_);
this->state_ = STATE_RECEIVED_SMS;

View File

@@ -93,10 +93,7 @@ bool SonoffD1Output::read_command_(uint8_t *cmd, size_t &len) {
if (this->read_array(cmd, 6)) {
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
char hex_buf[format_hex_pretty_size(6)];
ESP_LOGV(TAG,
"[%04d] Reading from dimmer:\n"
"[%04d] %s",
this->write_count_, this->write_count_, format_hex_pretty_to(hex_buf, cmd, 6));
ESP_LOGV(TAG, "[%04d] Reading from dimmer: %s", this->write_count_, format_hex_pretty_to(hex_buf, cmd, 6));
#endif
if (cmd[0] != 0xAA || cmd[1] != 0x55) {
@@ -190,10 +187,7 @@ bool SonoffD1Output::write_command_(uint8_t *cmd, const size_t len, bool needs_a
do {
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
char hex_buf[format_hex_pretty_size(SONOFF_D1_MAX_CMD_SIZE)];
ESP_LOGV(TAG,
"[%04d] Writing to the dimmer:\n"
"[%04d] %s",
this->write_count_, this->write_count_, format_hex_pretty_to(hex_buf, cmd, len));
ESP_LOGV(TAG, "[%04d] Writing to the dimmer: %s", this->write_count_, format_hex_pretty_to(hex_buf, cmd, len));
#endif
this->write_array(cmd, len);
this->write_count_++;

View File

@@ -174,20 +174,21 @@ struct SunAtTime {
// debug output like in example 25.a, p. 165
auto eq = equatorial_coordinate();
ESP_LOGV(TAG,
"jde: %f\n"
"T: %f\n"
"L_0: %f\n"
"M: %f\n"
"e: %f\n"
"C: %f\n"
"Odot: %f\n"
"Omega: %f\n"
"lambda: %f\n"
"epsilon_0: %f\n"
"epsilon: %f\n"
"v: %f\n"
"right_ascension: %f\n"
"declination: %f",
"Sun position:\n"
" jde: %f\n"
" T: %f\n"
" L_0: %f\n"
" M: %f\n"
" e: %f\n"
" C: %f\n"
" Odot: %f\n"
" Omega: %f\n"
" lambda: %f\n"
" epsilon_0: %f\n"
" epsilon: %f\n"
" v: %f\n"
" right_ascension: %f\n"
" declination: %f",
jde, t, mean_longitude(), mean_anomaly(), eccentricity(), equation_of_center(), true_longitude(), omega(),
apparent_longitude(), mean_obliquity(), true_obliquity(), true_anomaly(), eq.right_ascension,
eq.declination);

View File

@@ -70,14 +70,14 @@ static void usbh_print_intf_desc(const usb_intf_desc_t *intf_desc) {
static void usbh_print_cfg_desc(const usb_config_desc_t *cfg_desc) {
ESP_LOGV(TAG,
"*** Configuration descriptor ***\n"
"bLength %d\n"
"bDescriptorType %d\n"
"wTotalLength %d\n"
"bNumInterfaces %d\n"
"bConfigurationValue %d\n"
"iConfiguration %d\n"
"bmAttributes 0x%x\n"
"bMaxPower %dmA",
" bLength %d\n"
" bDescriptorType %d\n"
" wTotalLength %d\n"
" bNumInterfaces %d\n"
" bConfigurationValue %d\n"
" iConfiguration %d\n"
" bmAttributes 0x%x\n"
" bMaxPower %dmA",
cfg_desc->bLength, cfg_desc->bDescriptorType, cfg_desc->wTotalLength, cfg_desc->bNumInterfaces,
cfg_desc->bConfigurationValue, cfg_desc->iConfiguration, cfg_desc->bmAttributes, cfg_desc->bMaxPower * 2);
}
@@ -89,20 +89,20 @@ static void usb_client_print_device_descriptor(const usb_device_desc_t *devc_des
ESP_LOGV(TAG,
"*** Device descriptor ***\n"
"bLength %d\n"
"bDescriptorType %d\n"
"bcdUSB %d.%d0\n"
"bDeviceClass 0x%x\n"
"bDeviceSubClass 0x%x\n"
"bDeviceProtocol 0x%x\n"
"bMaxPacketSize0 %d\n"
"idVendor 0x%x\n"
"idProduct 0x%x\n"
"bcdDevice %d.%d0\n"
"iManufacturer %d\n"
"iProduct %d\n"
"iSerialNumber %d\n"
"bNumConfigurations %d",
" bLength %d\n"
" bDescriptorType %d\n"
" bcdUSB %d.%d0\n"
" bDeviceClass 0x%x\n"
" bDeviceSubClass 0x%x\n"
" bDeviceProtocol 0x%x\n"
" bMaxPacketSize0 %d\n"
" idVendor 0x%x\n"
" idProduct 0x%x\n"
" bcdDevice %d.%d0\n"
" iManufacturer %d\n"
" iProduct %d\n"
" iSerialNumber %d\n"
" bNumConfigurations %d",
devc_desc->bLength, devc_desc->bDescriptorType, ((devc_desc->bcdUSB >> 8) & 0xF),
((devc_desc->bcdUSB >> 4) & 0xF), devc_desc->bDeviceClass, devc_desc->bDeviceSubClass,
devc_desc->bDeviceProtocol, devc_desc->bMaxPacketSize0, devc_desc->idVendor, devc_desc->idProduct,

View File

@@ -58,10 +58,8 @@ std::vector<CdcEps> USBUartTypeCP210X::parse_descriptors(usb_device_handle_t dev
ESP_LOGE(TAG, "get_active_config_descriptor failed");
return {};
}
ESP_LOGD(TAG,
"bDeviceClass: %u, bDeviceSubClass: %u\n"
"bNumInterfaces: %u",
device_desc->bDeviceClass, device_desc->bDeviceSubClass, config_desc->bNumInterfaces);
ESP_LOGD(TAG, "bDeviceClass: %u, bDeviceSubClass: %u, bNumInterfaces: %u", device_desc->bDeviceClass,
device_desc->bDeviceSubClass, config_desc->bNumInterfaces);
if (device_desc->bDeviceClass != 0) {
ESP_LOGE(TAG, "bDeviceClass != 0");
return {};

View File

@@ -434,8 +434,8 @@ void VoiceAssistant::client_subscription(api::APIConnection *client, bool subscr
char new_peername[socket::SOCKADDR_STR_LEN];
ESP_LOGE(TAG,
"Multiple API Clients attempting to connect to Voice Assistant\n"
"Current client: %s (%s)\n"
"New client: %s (%s)",
" Current client: %s (%s)\n"
" New client: %s (%s)",
this->api_client_->get_name(), this->api_client_->get_peername_to(current_peername), client->get_name(),
client->get_peername_to(new_peername));
return;

View File

@@ -70,12 +70,13 @@ Wl134Component::Rfid134Error Wl134Component::read_packet_() {
RFID134_PACKET_CHECKSUM - RFID134_PACKET_RESERVED1);
ESP_LOGV(TAG,
"Tag id: %012lld\n"
"Country: %03d\n"
"isData: %s\n"
"isAnimal: %s\n"
"Reserved0: %d\n"
"Reserved1: %" PRId32,
"RFID134 Tag:\n"
" Tag id: %012lld\n"
" Country: %03d\n"
" isData: %s\n"
" isAnimal: %s\n"
" Reserved0: %d\n"
" Reserved1: %" PRId32,
reading.id, reading.country, reading.isData ? "true" : "false", reading.isAnimal ? "true" : "false",
reading.reserved0, reading.reserved1);

View File

@@ -72,10 +72,8 @@ void XGZP68XXComponent::update() {
temperature_raw = encode_uint16(data[3], data[4]);
// Convert the pressure data to hPa
ESP_LOGV(TAG,
"Got raw pressure=%" PRIu32 ", raw temperature=%u\n"
"K value is %u",
pressure_raw, temperature_raw, this->k_value_);
ESP_LOGV(TAG, "Got raw pressure=%" PRIu32 ", raw temperature=%u, K value=%u", pressure_raw, temperature_raw,
this->k_value_);
// Sign extend the pressure
float pressure_in_pa = (float) (((int32_t) pressure_raw << 8) >> 8);

View File

@@ -841,6 +841,39 @@ def lint_no_scanf(fname, match):
)
LOG_MULTILINE_RE = re.compile(r"ESP_LOG\w+\s*\(.*?;", re.DOTALL)
LOG_BAD_CONTINUATION_RE = re.compile(r'\\n(?:[^ \\"\r\n\t]|"\s*\n\s*"[^ \\])')
LOG_PERCENT_S_CONTINUATION_RE = re.compile(r'\\n(?:%s|"\s*\n\s*"%s)')
@lint_content_check(include=cpp_include)
def lint_log_multiline_continuation(fname, content):
errs = []
for log_match in LOG_MULTILINE_RE.finditer(content):
log_text = log_match.group(0)
for bad_match in LOG_BAD_CONTINUATION_RE.finditer(log_text):
# %s may expand to a whitespace prefix at runtime, skip those
if LOG_PERCENT_S_CONTINUATION_RE.match(log_text, bad_match.start()):
continue
# Calculate line number from position in full content
abs_pos = log_match.start() + bad_match.start()
lineno = content.count("\n", 0, abs_pos) + 1
col = abs_pos - content.rfind("\n", 0, abs_pos)
errs.append(
(
lineno,
col,
"Multi-line log message has a continuation line that does "
"not start with a space. The log viewer uses leading "
"whitespace to detect continuation lines and re-add the "
f"log tag prefix (e.g. {highlight('[C][component:042]:')}).\n"
"Either start the continuation with a space/indent, or "
"split into separate ESP_LOG* calls.",
)
)
return errs
@lint_content_find_check(
"ESP_LOG",
include=["*.h", "*.tcc"],