Merge pull request #19 from TheBlueMatt/2021-04-invoice-incl
[ldk-c-bindings] / lightning-c-bindings / src / lightning / util / logger.rs
index 3cfcf6dbea454c0c9394207aa75cde3fb31339cc..037324543c1d56e6fb25352e7167eb63c049ed4f 100644 (file)
@@ -13,6 +13,7 @@
 //! The second one, client-side by implementing check against Record Level field.
 //! Each module may have its own Logger or share one.
 
+use std::str::FromStr;
 use std::ffi::c_void;
 use bitcoin::hashes::Hash;
 use crate::c_types::*;
@@ -107,12 +108,10 @@ pub struct Logger {
        /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
-unsafe impl Sync for Logger {}
-unsafe impl Send for Logger {}
 
 use lightning::util::logger::Logger as rustLogger;
 impl rustLogger for Logger {
-       fn log(&self, record: &lightning::util::logger::Record) {
+       fn log(&self, mut record: &lightning::util::logger::Record) {
                let mut local_record = std::ffi::CString::new(format!("{}", record.args)).unwrap();
                (self.log)(self.this_arg, local_record.as_ptr())
        }