From 168a3fd34824adc9c6a606cd144219701f15cccf Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Wed, 17 Dec 2025 21:23:46 -0500 Subject: [Rust] Replace `log` with `tracing` - Added more documentation - Replaced global named logger for plugins, fixing the issue when the CU has multiple (e.g. statically linked demo) - Simplified some misc code This is a breaking change, but I believe there is no better time to make it, we cannot continue to use the `log` crate, it is too limited for our needs. --- plugins/svd/src/mapper.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/svd/src/mapper.rs') diff --git a/plugins/svd/src/mapper.rs b/plugins/svd/src/mapper.rs index 4c49145b..2c09eb95 100644 --- a/plugins/svd/src/mapper.rs +++ b/plugins/svd/src/mapper.rs @@ -6,6 +6,7 @@ use binaryninja::rc::Ref; use binaryninja::section::{SectionBuilder, Semantics}; use binaryninja::segment::{SegmentBuilder, SegmentFlags}; use binaryninja::symbol::{SymbolBuilder, SymbolType}; +use binaryninja::tracing; use binaryninja::types::{ BaseStructure, EnumerationBuilder, MemberAccess, MemberScope, NamedTypeReference, NamedTypeReferenceClass, StructureBuilder, StructureMember, Type, TypeBuilder, @@ -78,7 +79,7 @@ impl DeviceMapper { } pub fn map_to_view(&self, view: &BinaryView) { - log::info!("Mapping device... {}", self.device.name); + tracing::info!("Mapping device... {}", self.device.name); for peripheral in &self.device.peripherals { match peripheral { Peripheral::Single(info) => { @@ -143,7 +144,7 @@ impl DeviceMapper { address_block: &AddressBlock, ) { let block_addr = peripheral.base_address + address_block.offset as u64; - log::info!( + tracing::info!( "Mapping peripheral block @ 0x{:x} for {}", block_addr, peripheral.name @@ -176,7 +177,7 @@ impl DeviceMapper { ); if !added_memory { - log::error!( + tracing::error!( "Failed to add memory for peripheral block! {} @ 0x{:x}", block_name, block_addr -- cgit v1.3.1