Skip to content

Commit

Permalink
Improve logs
Browse files Browse the repository at this point in the history
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
  • Loading branch information
HenrikJannsen authored and alejandrogarcia83 committed Jun 12, 2024
1 parent 5d8ca12 commit 78287da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ default Set<String> getExcludedFields() {
default <B extends Message.Builder> B clearAnnotatedFields(B builder) {
Set<String> excludedFields = getExcludedFields();
if (!excludedFields.isEmpty()) {
getLogger().error("Clear fields in builder annotated with @ExcludeForHash: {}", excludedFields);
getLogger().debug("Clear fields in builder annotated with @ExcludeForHash: {}", excludedFields);
}
for (Descriptors.FieldDescriptor fieldDesc : builder.getAllFields().keySet()) {
if (excludedFields.contains(fieldDesc.getName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

import com.google.common.base.Preconditions;

import org.bouncycastle.util.encoders.Hex;

import java.security.PublicKey;

import java.time.Clock;
Expand Down Expand Up @@ -215,7 +217,9 @@ boolean isSignatureValid() {
boolean result = Sig.verify(this.ownerPubKey, hashOfDataAndSeqNr, this.signature);

if (!result)
log.warn("ProtectedStorageEntry::isSignatureValid() failed.\n{}}", this);
log.warn("Invalid signature for {}.\nSerialized data as hex={}}",
protectedStoragePayload.getClass().getSimpleName(),
Hex.toHexString(protectedStoragePayload.toProtoMessage().toByteArray()));

return result;
} catch (CryptoException e) {
Expand Down

0 comments on commit 78287da

Please sign in to comment.