Kaynağa Gözat

explorer: reduce logging verbosity when loading contract source code and metadata

Changed logging for inserting contract source and metadata from `info` to `debug` to reduce verbosity. Added a high-level `info` log to indicate successful loading of native contract metadata.
kalm 1 yıl önce
ebeveyn
işleme
aaff4dd6a0

+ 3 - 3
bin/explorer/explorerd/src/contract_meta_store.rs

@@ -18,7 +18,7 @@
 
 use std::sync::{Arc, Mutex, MutexGuard};
 
-use log::{debug, info};
+use log::debug;
 use sled_overlay::{sled, SledDbOverlay};
 
 use darkfi::{blockchain::SledDbOverlayPtr, Error, Result};
@@ -221,7 +221,7 @@ impl ContractMetadataStoreOverlay {
                 key.as_bytes(),
                 source_file.content.as_bytes(),
             )?;
-            info!(target: "explorerd::contract_meta_store::insert_source", "Inserted contract source for path {}", key);
+            debug!(target: "explorerd::contract_meta_store::insert_source", "Inserted contract source for path {}", key);
         }
 
         // Commit the changes
@@ -286,7 +286,7 @@ impl ContractMetadataStoreOverlay {
                 contract_id.to_string().as_bytes(),
                 &serialized_metadata,
             )?;
-            info!(target: "explorerd::contract_meta_store::insert_metadata",
+            debug!(target: "explorerd::contract_meta_store::insert_metadata",
                 "Inserted contract metadata for contract_id {}: {metadata:?}", contract_id.to_string());
         }
 

+ 2 - 1
bin/explorer/explorerd/src/main.rs

@@ -195,7 +195,7 @@ impl ExplorerService {
 
             // Add source code into the `ContractMetaStore`
             self.db.contract_meta_store.insert_source(contract_id, &source_code)?;
-            info!("Loaded contract source for contract {}", contract_id_str.to_string());
+            info!(target: "explorerd: load_native_contract_sources", "Successfully loaded contract source for native contract {}", contract_id_str.to_string());
         }
         Ok(())
     }
@@ -223,6 +223,7 @@ impl ExplorerService {
 
         // Load contract metadata into the `ContractMetaStore`
         self.db.contract_meta_store.insert_metadata(&contract_ids, &metadatas)?;
+        info!(target: "explorerd: load_native_contract_metadata", "Successfully loaded metadat for native contracts");
 
         Ok(())
     }