From e0c736271a3360cab91346a47fbf2620e456d738 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Wed, 11 Sep 2024 21:49:48 +0800 Subject: [PATCH] feat: merge https://github.com/google/native-pkcs11/pull/340 --- native-pkcs11/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() } }