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/warp/src/plugin/ffi/container.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/warp/src/plugin/ffi') diff --git a/plugins/warp/src/plugin/ffi/container.rs b/plugins/warp/src/plugin/ffi/container.rs index 72c85366..6c2551c1 100644 --- a/plugins/warp/src/plugin/ffi/container.rs +++ b/plugins/warp/src/plugin/ffi/container.rs @@ -10,6 +10,7 @@ use binaryninja::architecture::CoreArchitecture; use binaryninja::binary_view::BinaryView; use binaryninja::rc::Ref; use binaryninja::string::BnString; +use binaryninja::tracing; use binaryninja::types::Type; use binaryninjacore_sys::{BNArchitecture, BNBinaryView, BNType}; use std::ffi::{c_char, CStr}; @@ -219,7 +220,7 @@ pub unsafe extern "C" fn BNWARPContainerFetchFunctions( let guids = unsafe { std::slice::from_raw_parts(guids, count) }; if let Err(e) = container.fetch_functions(&target, &source_tags, guids) { - log::error!("Failed to fetch functions: {}", e); + tracing::error!("Failed to fetch functions: {}", e); } } @@ -586,7 +587,7 @@ pub unsafe extern "C" fn BNWARPContainerSearch( let result = match container.search(&query) { Ok(result) => result, Err(err) => { - log::error!("Failed to search container {:?}: {}", query.deref(), err); + tracing::error!("Failed to search container {:?}: {}", query.deref(), err); return std::ptr::null_mut(); } }; -- cgit v1.3.1