diff --git a/native-pkcs11/src/lib.rs b/native-pkcs11/src/lib.rs index d71462d..c2cadf7 100644 --- a/native-pkcs11/src/lib.rs +++ b/native-pkcs11/src/lib.rs @@ -68,7 +68,12 @@ where match f() { Ok(()) => CKR_OK, Err(e) => { - tracing::error!(%e); + match e { + // Some PKCS #11 return values indicate routine conditions that + // should not be logged at the default log level. + Error::AttributeTypeInvalid(_) => tracing::debug!(%e), + _ => tracing::error!(%e), + } e.into() } }