diff options
| author | Mason Reed <mason@vector35.com> | 2025-12-19 19:15:38 -0500 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-01-11 10:36:01 -0800 |
| commit | 587a5c0c537a4b3bc5c737e3b3fc1fd5fbca3a59 (patch) | |
| tree | a01357f3a1ad00bdf6ebde29dfae673da2f78a57 /rust/examples/high_level_il.rs | |
| parent | 6f75ca031aa7e8f7e1c706d1880b202137b1996f (diff) | |
[Rust] Update examples to use tracing
Diffstat (limited to 'rust/examples/high_level_il.rs')
| -rw-r--r-- | rust/examples/high_level_il.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rust/examples/high_level_il.rs b/rust/examples/high_level_il.rs index ddc8f08d..a099437a 100644 --- a/rust/examples/high_level_il.rs +++ b/rust/examples/high_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()); |
