Skip to content

Commit

Permalink
feat(log): add ResourceDeletion logger
Browse files Browse the repository at this point in the history
Adds a logger for the new ResourceDeletion ValueType. This record only contains a resource key.
  • Loading branch information
remcowesterhoud committed Feb 1, 2023
1 parent f107d9e commit 94fe10d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import io.camunda.zeebe.protocol.record.value.ProcessInstanceRecordValue;
import io.camunda.zeebe.protocol.record.value.ProcessInstanceResultRecordValue;
import io.camunda.zeebe.protocol.record.value.ProcessMessageSubscriptionRecordValue;
import io.camunda.zeebe.protocol.record.value.ResourceDeletionRecordValue;
import io.camunda.zeebe.protocol.record.value.SignalRecordValue;
import io.camunda.zeebe.protocol.record.value.SignalSubscriptionRecordValue;
import io.camunda.zeebe.protocol.record.value.TimerRecordValue;
Expand Down Expand Up @@ -106,6 +107,8 @@ public RecordStreamLogger(final RecordStreamSource recordStreamSource) {

valueTypeLoggers.put(ValueType.SIGNAL_SUBSCRIPTION, this::logSignalSubscriptionRecordValue);
valueTypeLoggers.put(ValueType.SIGNAL, this::logSignalRecordValue);

valueTypeLoggers.put(ValueType.RESOURCE_DELETION, this::logResourceDeletionRecordValue);
}

public void log() {
Expand Down Expand Up @@ -404,6 +407,11 @@ private String logSignalRecordValue(final Record<?> record) {
return joiner.toString();
}

private String logResourceDeletionRecordValue(final Record<?> record) {
final ResourceDeletionRecordValue value = (ResourceDeletionRecordValue) record.getValue();
return String.format("(Resource key: %d", value.getResourceKey());
}

protected Map<ValueType, Function<Record<?>, String>> getValueTypeLoggers() {
return valueTypeLoggers;
}
Expand Down

0 comments on commit 94fe10d

Please sign in to comment.