Improve logs

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2024-06-08 14:51:11 +07:00
parent c70cc4a5d6
commit b3288e3839
No known key found for this signature in database
GPG Key ID: 02AA2BAE387C8307
2 changed files with 6 additions and 2 deletions

View File

@ -103,7 +103,7 @@ public interface ExcludeForHashAwareProto extends Proto {
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())) {

View File

@ -32,6 +32,8 @@ import com.google.protobuf.Message;
import com.google.common.base.Preconditions;
import org.bouncycastle.util.encoders.Hex;
import java.security.PublicKey;
import java.time.Clock;
@ -215,7 +217,9 @@ public class ProtectedStorageEntry implements NetworkPayload, PersistablePayload
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) {