X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Futil%2Flogger.rs;fp=lightning-c-bindings%2Fsrc%2Flightning%2Futil%2Flogger.rs;h=af9ceefcd03a5d6dad799d52ce0d806a77e8090c;hb=636543d86915837013c3eb1e0a9ea96114ef73fc;hp=ad32191186b91e31c34a1b312e3b0374ebd60612;hpb=d5bd2d5366d797aa990799f78cc987b0be73de71;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning/util/logger.rs b/lightning-c-bindings/src/lightning/util/logger.rs index ad32191..af9ceef 100644 --- a/lightning-c-bindings/src/lightning/util/logger.rs +++ b/lightning-c-bindings/src/lightning/util/logger.rs @@ -147,6 +147,11 @@ pub extern "C" fn Level_hash(o: &Level) -> u64 { core::hash::Hash::hash(&o.to_native(), &mut hasher); core::hash::Hasher::finish(&hasher) } +#[no_mangle] +/// Get the string representation of a Level object +pub extern "C" fn Level_to_str(o: &crate::lightning::util::logger::Level) -> Str { + alloc::format!("{}", &o.to_native()).into() +} /// Returns the most verbose logging level. #[must_use] #[no_mangle]