X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Futil%2Flogger.rs;h=90994504c9d678cf1cc8852b4f9f1f3750a65376;hp=8a1fbb15d54340e37dccf5b0f6592a6020659681;hb=a132c4d7f8648278537854ae08a83d704853ed42;hpb=b33df3ebba7af25aa0e53654953d8493406109ed diff --git a/lightning-c-bindings/src/util/logger.rs b/lightning-c-bindings/src/util/logger.rs index 8a1fbb1..9099450 100644 --- a/lightning-c-bindings/src/util/logger.rs +++ b/lightning-c-bindings/src/util/logger.rs @@ -74,6 +74,7 @@ impl Level { } } } +/// Creates a copy of the Level #[no_mangle] pub extern "C" fn Level_clone(orig: &Level) -> Level { orig.clone() @@ -89,9 +90,13 @@ pub extern "C" fn Level_max() -> crate::util::logger::Level { /// A trait encapsulating the operations required of a logger #[repr(C)] pub struct Logger { + /// An opaque pointer which is passed to your function implementations as an argument. + /// This has no meaning in the LDK, and can be NULL or any other value. pub this_arg: *mut c_void, /// Logs the `Record` pub log: extern "C" fn (this_arg: *const c_void, record: *const std::os::raw::c_char), +/// Frees any resources associated with this object given its this_arg pointer. +/// 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, } unsafe impl Sync for Logger {}