@@ -187,12 +187,14 @@ impl OnDiskKeyInfoManager {
187187 for app_name_dir_path in list_dirs ( & mappings_dir_path) ?. iter ( ) {
188188 for provider_dir_path in list_dirs ( & app_name_dir_path) ?. iter ( ) {
189189 for key_name_file_path in list_files ( & provider_dir_path) ?. iter ( ) {
190- info ! ( "Found mapping file: {:?}." , key_name_file_path) ;
190+ if crate :: utils:: GlobalConfig :: log_error_details ( ) {
191+ info ! ( "Found mapping file: {:?}." , key_name_file_path) ;
192+ }
191193 let mut key_info = Vec :: new ( ) ;
192194 let mut key_info_file = File :: open ( & key_name_file_path) ?;
193195 let _ = key_info_file. read_to_end ( & mut key_info) ?;
194196 let key_info = bincode:: deserialize ( & key_info[ ..] ) . or_else ( |e| {
195- error ! ( "Error deserializing key info ({}). " , e) ;
197+ format_error ! ( "Error deserializing key info" , e) ;
196198 Err ( Error :: new ( ErrorKind :: Other , "error deserializing key info" ) )
197199 } ) ?;
198200 match base64_data_triple_to_key_triple (
@@ -210,13 +212,20 @@ impl OnDiskKeyInfoManager {
210212 let _ = key_store. insert ( key_triple, key_info) ;
211213 }
212214 Err ( string) => {
213- error ! ( "Failed to convert the mapping path found to an UTF-8 string (error: {})." , string) ;
215+ format_error ! (
216+ "Failed to convert the mapping path found to an UTF-8 string" ,
217+ string
218+ ) ;
214219 }
215220 }
216221 }
217222 }
218223 }
219224
225+ if !crate :: utils:: GlobalConfig :: log_error_details ( ) {
226+ info ! ( "Found {} mapping files" , key_store. len( ) ) ;
227+ }
228+
220229 Ok ( OnDiskKeyInfoManager {
221230 key_store,
222231 mappings_dir_path,
@@ -240,7 +249,7 @@ impl OnDiskKeyInfoManager {
240249
241250 let mut mapping_file = fs:: File :: create ( & key_name_file_path) ?;
242251 mapping_file. write_all ( & bincode:: serialize ( key_info) . or_else ( |e| {
243- error ! ( "Error serializing key info ({}). " , e) ;
252+ format_error ! ( "Error serializing key info" , e) ;
244253 Err ( Error :: new ( ErrorKind :: Other , "error serializing key info" ) )
245254 } ) ?)
246255 }
0 commit comments