Skip to content

Commit 2617f3a

Browse files
chore: improve logging
1 parent 07ae839 commit 2617f3a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/env/artifact/environment/roomartifact/AbstractActuatorInRoomArtifact.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ protected void init(final ActuatorType actuatorType, final RoomID roomId) {
3636
if (resultID.isPresent()) {
3737
this.actuatorID = resultID.get();
3838
} else {
39-
throw new IllegalArgumentException("No actuator of type " + actuatorType + " available in room: " + roomId);
39+
throw new IllegalArgumentException(
40+
"No actuator of type " + actuatorType + " available in room: " + roomId.getId()
41+
);
4042
}
4143
}
4244

src/env/infrastructure/events/KafkaClient.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Objects;
2626
import java.util.Optional;
2727
import java.util.function.Consumer;
28+
import java.util.logging.Logger;
2829

2930
/**
3031
* This class manage the Kafka client needed to consume events.
@@ -91,8 +92,10 @@ public final void notify(final Event<?> eventToSend) {
9192
@Override
9293
public final void poll(final Consumer<Event<?>> eventConsumer) {
9394
while (true) {
94-
this.kafkaConsumer.poll(Duration.ofMillis(POLLING_TIME)).forEach(event ->
95-
this.eventDeserializer.fromString(event.key(), event.value()).ifPresent(eventConsumer));
95+
this.kafkaConsumer.poll(Duration.ofMillis(POLLING_TIME)).forEach(event -> {
96+
Logger.getLogger(KafkaClient.class.toString()).info(event.value());
97+
this.eventDeserializer.fromString(event.key(), event.value()).ifPresent(eventConsumer);
98+
});
9699
}
97100
}
98101

0 commit comments

Comments
 (0)