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. --- view/minidump/src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'view/minidump/src/lib.rs') diff --git a/view/minidump/src/lib.rs b/view/minidump/src/lib.rs index 64aaddd6..00fed601 100644 --- a/view/minidump/src/lib.rs +++ b/view/minidump/src/lib.rs @@ -1,8 +1,7 @@ use binaryninja::binary_view::BinaryView; use binaryninja::command::{register_command, Command}; use binaryninja::custom_binary_view::register_view_type; -use binaryninja::logger::Logger; -use log::{debug, LevelFilter}; +use binaryninja::tracing; mod command; mod view; @@ -22,14 +21,11 @@ impl Command for PrintMemoryInformationCommand { #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn CorePluginInit() -> bool { - Logger::new("Minidump") - .with_level(LevelFilter::Trace) - .init(); - - debug!("Registering minidump binary view type"); + binaryninja::tracing_init!("Minidump"); + tracing::debug!("Registering minidump binary view type"); register_view_type("Minidump", "Minidump", view::MinidumpBinaryViewType::new); - debug!("Registering minidump plugin commands"); + tracing::debug!("Registering minidump plugin commands"); register_command( "Minidump\\[DEBUG] Print Minidump Memory Information", "Print a human-readable description of the contents of the MinidumpMemoryInfoList stream in the loaded minidump", -- cgit v1.3.1