mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
[mqtt] Remove redundant "mqtt" from log messages (#8968)
This commit is contained in:
parent
4f87bea788
commit
518bce50a5
@ -201,13 +201,13 @@ void MQTTClientComponent::start_dnslookup_() {
|
||||
}
|
||||
case ERR_INPROGRESS: {
|
||||
// wait for callback
|
||||
ESP_LOGD(TAG, "Resolving MQTT broker IP address...");
|
||||
ESP_LOGD(TAG, "Resolving broker IP address");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
case ERR_ARG: {
|
||||
// error
|
||||
ESP_LOGW(TAG, "Error resolving MQTT broker IP address: %d", err);
|
||||
ESP_LOGW(TAG, "Error resolving broker IP address: %d", err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -221,7 +221,7 @@ void MQTTClientComponent::check_dnslookup_() {
|
||||
}
|
||||
|
||||
if (this->dns_resolve_error_) {
|
||||
ESP_LOGW(TAG, "Couldn't resolve IP address for '%s'!", this->credentials_.address.c_str());
|
||||
ESP_LOGW(TAG, "Couldn't resolve IP address for '%s'", this->credentials_.address.c_str());
|
||||
this->state_ = MQTT_CLIENT_DISCONNECTED;
|
||||
return;
|
||||
}
|
||||
@ -251,7 +251,7 @@ void MQTTClientComponent::start_connect_() {
|
||||
if (!network::is_connected())
|
||||
return;
|
||||
|
||||
ESP_LOGI(TAG, "Connecting to MQTT...");
|
||||
ESP_LOGI(TAG, "Connecting");
|
||||
// Force disconnect first
|
||||
this->mqtt_backend_.disconnect();
|
||||
|
||||
@ -292,7 +292,7 @@ void MQTTClientComponent::check_connected() {
|
||||
this->state_ = MQTT_CLIENT_CONNECTED;
|
||||
this->sent_birth_message_ = false;
|
||||
this->status_clear_warning();
|
||||
ESP_LOGI(TAG, "MQTT Connected!");
|
||||
ESP_LOGI(TAG, "Connected");
|
||||
// MQTT Client needs some time to be fully set up.
|
||||
delay(100); // NOLINT
|
||||
|
||||
@ -341,7 +341,7 @@ void MQTTClientComponent::loop() {
|
||||
if (!network::is_connected()) {
|
||||
reason_s = LOG_STR("WiFi disconnected");
|
||||
}
|
||||
ESP_LOGW(TAG, "MQTT Disconnected: %s.", LOG_STR_ARG(reason_s));
|
||||
ESP_LOGW(TAG, "Disconnected: %s", LOG_STR_ARG(reason_s));
|
||||
this->disconnect_reason_.reset();
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ void MQTTClientComponent::loop() {
|
||||
case MQTT_CLIENT_CONNECTED:
|
||||
if (!this->mqtt_backend_.connected()) {
|
||||
this->state_ = MQTT_CLIENT_DISCONNECTED;
|
||||
ESP_LOGW(TAG, "Lost MQTT Client connection!");
|
||||
ESP_LOGW(TAG, "Lost client connection");
|
||||
this->start_dnslookup_();
|
||||
} else {
|
||||
if (!this->birth_message_.topic.empty() && !this->sent_birth_message_) {
|
||||
@ -378,7 +378,7 @@ void MQTTClientComponent::loop() {
|
||||
}
|
||||
|
||||
if (millis() - this->last_connected_ > this->reboot_timeout_ && this->reboot_timeout_ != 0) {
|
||||
ESP_LOGE(TAG, "Can't connect to MQTT... Restarting...");
|
||||
ESP_LOGE(TAG, "Can't connect; restarting");
|
||||
App.reboot();
|
||||
}
|
||||
}
|
||||
@ -396,7 +396,7 @@ bool MQTTClientComponent::subscribe_(const char *topic, uint8_t qos) {
|
||||
ESP_LOGV(TAG, "subscribe(topic='%s')", topic);
|
||||
} else {
|
||||
delay(5);
|
||||
ESP_LOGV(TAG, "Subscribe failed for topic='%s'. Will retry later.", topic);
|
||||
ESP_LOGV(TAG, "Subscribe failed for topic='%s'. Will retry", topic);
|
||||
this->status_momentary_warning("subscribe", 1000);
|
||||
}
|
||||
return ret != 0;
|
||||
@ -499,7 +499,7 @@ bool MQTTClientComponent::publish(const MQTTMessage &message) {
|
||||
ESP_LOGV(TAG, "Publish(topic='%s' payload='%s' retain=%d qos=%d)", message.topic.c_str(), message.payload.c_str(),
|
||||
message.retain, message.qos);
|
||||
} else {
|
||||
ESP_LOGV(TAG, "Publish failed for topic='%s' (len=%u). will retry later..", message.topic.c_str(),
|
||||
ESP_LOGV(TAG, "Publish failed for topic='%s' (len=%u). Will retry", message.topic.c_str(),
|
||||
message.payload.length());
|
||||
this->status_momentary_warning("publish", 1000);
|
||||
}
|
||||
@ -515,7 +515,7 @@ bool MQTTClientComponent::publish_json(const std::string &topic, const json::jso
|
||||
void MQTTClientComponent::enable() {
|
||||
if (this->state_ != MQTT_CLIENT_DISABLED)
|
||||
return;
|
||||
ESP_LOGD(TAG, "Enabling MQTT...");
|
||||
ESP_LOGD(TAG, "Enabling");
|
||||
this->state_ = MQTT_CLIENT_DISCONNECTED;
|
||||
this->last_connected_ = millis();
|
||||
this->start_dnslookup_();
|
||||
@ -524,7 +524,7 @@ void MQTTClientComponent::enable() {
|
||||
void MQTTClientComponent::disable() {
|
||||
if (this->state_ == MQTT_CLIENT_DISABLED)
|
||||
return;
|
||||
ESP_LOGD(TAG, "Disabling MQTT...");
|
||||
ESP_LOGD(TAG, "Disabling");
|
||||
this->state_ = MQTT_CLIENT_DISABLED;
|
||||
this->on_shutdown();
|
||||
}
|
||||
|
@ -64,11 +64,11 @@ bool MQTTComponent::send_discovery_() {
|
||||
const MQTTDiscoveryInfo &discovery_info = global_mqtt_client->get_discovery_info();
|
||||
|
||||
if (discovery_info.clean) {
|
||||
ESP_LOGV(TAG, "'%s': Cleaning discovery...", this->friendly_name().c_str());
|
||||
ESP_LOGV(TAG, "'%s': Cleaning discovery", this->friendly_name().c_str());
|
||||
return global_mqtt_client->publish(this->get_discovery_topic_(discovery_info), "", 0, this->qos_, true);
|
||||
}
|
||||
|
||||
ESP_LOGV(TAG, "'%s': Sending discovery...", this->friendly_name().c_str());
|
||||
ESP_LOGV(TAG, "'%s': Sending discovery", this->friendly_name().c_str());
|
||||
|
||||
return global_mqtt_client->publish_json(
|
||||
this->get_discovery_topic_(discovery_info),
|
||||
|
Loading…
x
Reference in New Issue
Block a user