diff options
| author | Mason Reed <mason@vector35.com> | 2024-11-11 17:05:44 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2024-11-11 17:05:44 -0500 |
| commit | e856d391d377d0a723563925bb0a841ead5ae012 (patch) | |
| tree | 197df92e0dfc44e1f1e243bf4b35cd08ef8c1cfd /arch | |
| parent | 911203528b5a5bfc7a98e86ad55b80f7a1385969 (diff) | |
Add actual logger api to rust
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/msp430/src/lib.rs | 4 | ||||
| -rw-r--r-- | arch/riscv/src/lib.rs | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/msp430/src/lib.rs b/arch/msp430/src/lib.rs index fd8af7a7..7654b33c 100644 --- a/arch/msp430/src/lib.rs +++ b/arch/msp430/src/lib.rs @@ -2,6 +2,7 @@ extern crate binaryninja; extern crate log; extern crate msp430_asm; +use log::LevelFilter; use binaryninja::{add_optional_plugin_dependency, architecture::ArchitectureExt, callingconvention, custombinaryview::{BinaryViewType, BinaryViewTypeExt}, Endianness}; mod architecture; @@ -10,11 +11,12 @@ mod lift; mod register; use architecture::Msp430; +use binaryninja::logger::Logger; #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn CorePluginInit() -> bool { - binaryninja::logger::init(log::LevelFilter::Info); + Logger::new("MSP430").with_level(LevelFilter::Info).init(); let arch = binaryninja::architecture::register_architecture( "msp430", |custom_handle, handle| Msp430::new(handle, custom_handle), diff --git a/arch/riscv/src/lib.rs b/arch/riscv/src/lib.rs index e59f68e9..b56d15c4 100644 --- a/arch/riscv/src/lib.rs +++ b/arch/riscv/src/lib.rs @@ -8,7 +8,7 @@ use std::borrow::Cow; use std::fmt; use std::hash::Hash; use std::marker::PhantomData; - +use log::LevelFilter; use binaryninja::relocation::{Relocation, RelocationHandlerExt}; use binaryninja::{ add_optional_plugin_dependency, architecture, @@ -42,6 +42,7 @@ use riscv_dis::{ FloatReg, FloatRegType, Instr, IntRegType, Op, RegFile, Register as RiscVRegister, RiscVDisassembler, RoundMode, }; +use binaryninja::logger::Logger; enum RegType { Integer(u32), @@ -2891,7 +2892,7 @@ impl FunctionRecognizer for RiscVELFPLTRecognizer { #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn CorePluginInit() -> bool { - binaryninja::logger::init(log::LevelFilter::Trace); + Logger::new("RISCV").with_level(LevelFilter::Trace).init(); use riscv_dis::{RiscVIMACDisassembler, Rv32GRegs, Rv64GRegs}; let arch32 = |
