From 587a5c0c537a4b3bc5c737e3b3fc1fd5fbca3a59 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 19 Dec 2025 19:15:38 -0500 Subject: [Rust] Update examples to use tracing --- rust/examples/medium_level_il.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'rust/examples/medium_level_il.rs') diff --git a/rust/examples/medium_level_il.rs b/rust/examples/medium_level_il.rs index 543a0856..c9412d08 100644 --- a/rust/examples/medium_level_il.rs +++ b/rust/examples/medium_level_il.rs @@ -1,19 +1,22 @@ use binaryninja::binary_view::{BinaryViewBase, BinaryViewExt}; +use binaryninja::tracing::TracingLogListener; fn main() { - println!("Starting session..."); + tracing_subscriber::fmt::init(); + let _listener = TracingLogListener::new().register(); + // This loads all the core architecture, platform, etc plugins let headless_session = binaryninja::headless::Session::new().expect("Failed to initialize session"); - println!("Loading binary..."); + tracing::info!("Loading binary..."); let bv = headless_session .load("/bin/cat") .expect("Couldn't open `/bin/cat`"); - println!("Filename: `{}`", bv.file().filename()); - println!("File size: `{:#x}`", bv.len()); - println!("Function count: {}", bv.functions().len()); + tracing::info!("Filename: `{}`", bv.file().filename()); + tracing::info!("File size: `{:#x}`", bv.len()); + tracing::info!("Function count: {}", bv.functions().len()); for func in &bv.functions() { println!("{:?}:", func.symbol().full_name()); -- cgit v1.3.1