diff --git a/memflow-pcileech/examples/read_phys.rs b/memflow-pcileech/examples/read_phys.rs index cfd09fc..179b2d2 100644 --- a/memflow-pcileech/examples/read_phys.rs +++ b/memflow-pcileech/examples/read_phys.rs @@ -18,7 +18,7 @@ fn main() { ConnectorArgs::new() }; - let mut conn = memflow_pcileech::create_connector(&conn_args) + let mut conn = memflow_pcileech::create_connector(Level::Debug, &conn_args) .expect("unable to initialize memflow_pcileech"); let mut mem = vec![0; 8]; diff --git a/memflow-pcileech/src/lib.rs b/memflow-pcileech/src/lib.rs index 083abba..5470626 100644 --- a/memflow-pcileech/src/lib.rs +++ b/memflow-pcileech/src/lib.rs @@ -7,10 +7,10 @@ use std::ptr; use std::slice; use std::sync::{Arc, Mutex}; -use log::{error, info}; +use log::{error, info, Level}; -use memflow::prelude::v1::*; use memflow::derive::connector; +use memflow::prelude::v1::*; use leechcore_sys::*; @@ -339,7 +339,12 @@ impl PhysicalMemory for PciLeech { /// Creates a new PciLeech Connector instance. #[connector(name = "pcileech", ty = "PciLeech")] -pub fn create_connector(args: &ConnectorArgs) -> Result { +pub fn create_connector(log_level: Level, args: &ConnectorArgs) -> Result { + simple_logger::SimpleLogger::new() + .with_level(log_level.to_level_filter()) + .init() + .ok(); + let device = args .get("device") .or_else(|| args.get_default())