X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Futil%2Flogger.rs;h=7d0e7953f9d987f6df7ae252f28f0414cd85b936;hp=b4d7c1a741946e4238c2bb0891350d307b1e6779;hb=23b946be5cf633afdba94e12fd71380cafdf49be;hpb=b33cce1a6255564b88e0615eb5c7941bd7b15759 diff --git a/lightning-c-bindings/src/lightning/util/logger.rs b/lightning-c-bindings/src/lightning/util/logger.rs index b4d7c1a..7d0e795 100644 --- a/lightning-c-bindings/src/lightning/util/logger.rs +++ b/lightning-c-bindings/src/lightning/util/logger.rs @@ -24,6 +24,8 @@ use crate::c_types::*; #[derive(Clone)] #[repr(C)] pub enum Level { + /// Designates extremely verbose information, including gossip-induced messages + Gossip, /// Designates very low priority, often extremely verbose, information Trace, /// Designates lower priority information @@ -40,6 +42,7 @@ impl Level { #[allow(unused)] pub(crate) fn to_native(&self) -> nativeLevel { match self { + Level::Gossip => nativeLevel::Gossip, Level::Trace => nativeLevel::Trace, Level::Debug => nativeLevel::Debug, Level::Info => nativeLevel::Info, @@ -50,6 +53,7 @@ impl Level { #[allow(unused)] pub(crate) fn into_native(self) -> nativeLevel { match self { + Level::Gossip => nativeLevel::Gossip, Level::Trace => nativeLevel::Trace, Level::Debug => nativeLevel::Debug, Level::Info => nativeLevel::Info, @@ -60,6 +64,7 @@ impl Level { #[allow(unused)] pub(crate) fn from_native(native: &nativeLevel) -> Self { match native { + nativeLevel::Gossip => Level::Gossip, nativeLevel::Trace => Level::Trace, nativeLevel::Debug => Level::Debug, nativeLevel::Info => Level::Info, @@ -70,6 +75,7 @@ impl Level { #[allow(unused)] pub(crate) fn native_into(native: nativeLevel) -> Self { match native { + nativeLevel::Gossip => Level::Gossip, nativeLevel::Trace => Level::Trace, nativeLevel::Debug => Level::Debug, nativeLevel::Info => Level::Info, @@ -84,6 +90,10 @@ pub extern "C" fn Level_clone(orig: &Level) -> Level { orig.clone() } #[no_mangle] +/// Utility method to constructs a new Gossip-variant Level +pub extern "C" fn Level_gossip() -> Level { + Level::Gossip} +#[no_mangle] /// Utility method to constructs a new Trace-variant Level pub extern "C" fn Level_trace() -> Level { Level::Trace}