Skip to content

Commit

Permalink
Improve logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdgeisler committed Dec 6, 2022
1 parent a1078b9 commit 8a1d22f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected <T> void publish(final String topic, final T payload) {
}

protected <T> void subscribe(final String topic, final Class<T> payloadType, final Consumer<T> consumer) {
log.debug("Subscribe to MQTT: topic={}, payload={}", topic, payloadType.getSimpleName());
log.debug("Subscribe to MQTT topic: topic={}, payload={}", topic, payloadType.getSimpleName());
try {
this.mqtt.subscribe(topic, (t, message) -> {
log.debug("MQTT message received: topic={}, payload={}", t, this.toJSON(message));
Expand All @@ -72,7 +72,7 @@ protected <T> void subscribe(final String topic, final Class<T> payloadType, fin
}

protected void unsubscribe(final String topic) {
log.debug("Unsubscribe from MQTT: topic={}", topic);
log.debug("Unsubscribe from MQTT topic: topic={}", topic);
try {
this.mqtt.unsubscribe(topic);
} catch (MqttException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,28 @@ public static <D extends Device> Optional<DeviceAvailabilityState> getAvailabili

@Override
protected void onDeviceEvent(final DeviceAddedEvent<D> event) {
log.debug("Device added: {}", this.toJSON(event.data));
log.debug("Received device added event: {}", this.toJSON(event.data));

this.onDeviceCreated(event.data);
}

@Override
protected void onDeviceEvent(final DeviceConfigurationChangedEvent<D> event) {
log.debug("Device configuration changed: {}", this.toJSON(event.data));
log.debug("Received device configuration changed event: {}", this.toJSON(event.data));

this.onDeviceStateChanged(event.data);
}

@Override
protected void onDeviceEvent(final DeviceStateChangedEvent<D> event) {
log.debug("Device state changed: {}", this.toJSON(event.data));
log.debug("Received device state changed event: {}", this.toJSON(event.data));

this.onDeviceStateChanged(event.data);
}

@Override
protected void onDeviceEvent(final DeviceRemovedEvent<D> event) {
log.debug("Device removed: {}", this.toJSON(event.data));
log.debug("Received device removed event: {}", this.toJSON(event.data));
this.onDeviceRemoved(event.data);
}

Expand Down

0 comments on commit 8a1d22f

Please sign in to comment.