X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Futil%2Flogger.rs;h=e6b98de5b09a7688dda308cdcc2e5141e996025c;hb=b2f0ccc7e0ef8b31567cb017d0b7cce9f7204803;hp=8a1fbb15d54340e37dccf5b0f6592a6020659681;hpb=1495575b517c90da925698da14f627bf0d5b313f;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/util/logger.rs b/lightning-c-bindings/src/util/logger.rs index 8a1fbb1..e6b98de 100644 --- a/lightning-c-bindings/src/util/logger.rs +++ b/lightning-c-bindings/src/util/logger.rs @@ -1,3 +1,11 @@ +// This file is Copyright its original authors, visible in version control +// history and in the source files from which this was generated. +// +// This file is licensed under the license available in the LICENSE or LICENSE.md +// file in the root of this repository or, if no such file exists, the same +// license as that which applies to the original source files from which this +// source was automatically generated. + //! Log traits live here, which are called throughout the library to provide useful information for //! debugging purposes. //! @@ -74,6 +82,7 @@ impl Level { } } } +/// Creates a copy of the Level #[no_mangle] pub extern "C" fn Level_clone(orig: &Level) -> Level { orig.clone() @@ -89,9 +98,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 {}