Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellblazer committed May 27, 2024
1 parent 975d644 commit 6294390
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions thoth/src/main/java/com/salesforce/apollo/thoth/KerlDHT.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public List<KeyState_> append(KERL_ kerl) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error appending KERL: {} on: {}", ce.getMessage(), member.getId());
log.warn("error appending KERL: {} on: {}", ce.getMessage(), member.getId());
return Collections.emptyList();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -277,7 +277,7 @@ public KeyState_ append(KeyEvent_ event) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error appending Key Event: {} on: {}", ce.getMessage(), member.getId());
log.warn("error appending Key Event: {} on: {}", ce.getMessage(), member.getId());
return KeyState_.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -334,7 +334,7 @@ public Empty appendAttachments(List<AttachmentEvent> events) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error appending attachments: {} on: {}", ce.getMessage(), member.getId());
log.warn("error appending attachments: {} on: {}", ce.getMessage(), member.getId());
return Empty.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -367,7 +367,7 @@ public Empty appendValidations(Validations validations) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error appending validations: {} on: {}", ce.getMessage(), member.getId());
log.warn("error appending validations: {} on: {}", ce.getMessage(), member.getId());
return Empty.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -421,7 +421,7 @@ public Attachment getAttachment(EventCoords coordinates) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return null;
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -456,7 +456,7 @@ public KERL_ getKERL(Ident identifier) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return KERL_.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -531,7 +531,7 @@ public KeyState_ getKeyState(EventCoords coordinates) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return KeyState_.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand All @@ -541,7 +541,7 @@ public KeyState_ getKeyState(EventCoords coordinates) {
@Override
public KeyState_ getKeyState(Ident identifier, long sequenceNumber) {
var operation = "getKeyState(%s, %s)".formatted(Identifier.from(identifier), ULong.valueOf(sequenceNumber));
log.info("{} on: {}", operation, member.getId());
log.warn("{} on: {}", operation, member.getId());
if (identifier == null) {
return KeyState_.getDefaultInstance();
}
Expand All @@ -568,7 +568,7 @@ public KeyState_ getKeyState(Ident identifier, long sequenceNumber) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return KeyState_.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -604,7 +604,7 @@ public KeyState_ getKeyState(Ident identifier) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return KeyState_.getDefaultInstance();
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -640,7 +640,7 @@ public KeyStateWithAttachments_ getKeyStateWithAttachments(EventCoords coordinat
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} on: {}", operation, member.getId(), ce);
log.warn("error {} on: {}", operation, member.getId(), ce);
return null;
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -676,7 +676,7 @@ public KeyStateWithEndorsementsAndValidations_ getKeyStateWithEndorsementsAndVal
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return null;
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -712,7 +712,7 @@ public Validations getValidations(EventCoords coordinates) {
return null;
} catch (ExecutionException e) {
if (e.getCause() instanceof CompletionException ce) {
log.info("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
log.warn("error {} : {} on: {}", operation, ce.getMessage(), member.getId());
return null;
}
throw new IllegalStateException(e.getCause());
Expand Down Expand Up @@ -1046,31 +1046,31 @@ private class Service implements ProtoKERLService {

@Override
public List<KeyState_> append(KERL_ kerl_) {
log.info("appending kerl on: {}", member.getId());
log.debug("appending kerl on: {}", member.getId());
return complete(k -> k.append(kerl_));
}

@Override
public List<KeyState_> append(List<KeyEvent_> events) {
log.info("appending events on: {}", member.getId());
log.debug("appending events on: {}", member.getId());
return complete(k -> k.append(events));
}

@Override
public List<KeyState_> append(List<KeyEvent_> events, List<AttachmentEvent> attachments) {
log.info("appending events and attachments on: {}", member.getId());
log.debug("appending events and attachments on: {}", member.getId());
return complete(k -> k.append(events, attachments));
}

@Override
public Empty appendAttachments(List<AttachmentEvent> attachments) {
log.info("append attachments on: {}", member.getId());
log.debug("append attachments on: {}", member.getId());
return complete(k -> k.appendAttachments(attachments));
}

@Override
public Empty appendValidations(Validations validations) {
log.info("append validations on: {}", member.getId());
log.debug("append validations on: {}", member.getId());
return complete(k -> k.appendValidations(validations));
}

Expand Down

0 comments on commit 6294390

Please sign in to comment.