Skip to content

Commit

Permalink
Remove env_logger and log from the dependencies list
Browse files Browse the repository at this point in the history
  • Loading branch information
chosungmann committed Oct 22, 2024
1 parent 44c7bcb commit eb97c4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ miette = { version = "7.2.0", features = ["fancy"] }
[dependencies]
autocxx = "0.27.0"
cxx = "1.0.129"
env_logger = "0.11.5"
log = "0.4.22"
7 changes: 3 additions & 4 deletions examples/crash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ struct Delegate;

impl breakpad_rs::ExceptionHandlerDelegate for Delegate {
fn did_write_minidump(&self, working_path: String, minidump_id: String) {
log::debug!("[did_write_minidump] working_path={working_path} minidump_id={minidump_id}");
println!("[did_write_minidump] working_path={working_path} minidump_id={minidump_id}");
}

fn get_working_path(&self) -> String {
log::debug!("[get_working_path] return=.");
println!("[get_working_path] return=.");
String::from(".")
}

fn should_write_minidump(&self) -> bool {
log::debug!("[should_write_minidump] return=true");
println!("[should_write_minidump] return=true");
true
}
}

fn main() {
env_logger::init();
let _breakpad = breakpad_rs::Breakpad::new(Some(Box::new(Delegate)));
unsafe {
let null: *mut u8 = std::ptr::null_mut();
Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,15 @@ impl ffi::breakpad::ExceptionHandlerDelegate_methods for ExceptionHandlerDelegat
}
}

#[allow(unused_variables)]
pub trait ExceptionHandlerDelegate {
fn did_write_minidump(&self, working_path: String, minidump_id: String) {
log::debug!("[did_write_minidump] working_path={working_path} minidump_id={minidump_id}");
}
fn did_write_minidump(&self, working_path: String, minidump_id: String) {}

fn get_working_path(&self) -> String {
log::debug!("[get_working_path] return=empty string");
String::new()
}

fn should_write_minidump(&self) -> bool {
log::debug!("[should_write_minidump] return=true");
true
}
}
Expand Down

0 comments on commit eb97c4c

Please sign in to comment.