X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Futil%2Flogger.rs;h=92ea8ffed55a91c218c4481e01a83f924536585d;hb=8e472669a1326d13424f3ebde40b6b6ff4e0a94d;hp=f1534933792949a41318c3b80e0cc1847cbf63f4;hpb=6b43153861c4f8dd1f44da737ad0b06eab8659e7;p=rust-lightning diff --git a/lightning/src/util/logger.rs b/lightning/src/util/logger.rs index f1534933..92ea8ffe 100644 --- a/lightning/src/util/logger.rs +++ b/lightning/src/util/logger.rs @@ -98,6 +98,10 @@ pub struct Record<'a> { /// The verbosity level of the message. pub level: Level, /// The node id of the peer pertaining to the logged record. + /// + /// Note that in some cases a [`Self::channel_id`] may be filled in but this may still be + /// `None`, depending on if the peer information is readily available in LDK when the log is + /// generated. pub peer_id: Option, /// The channel id of the channel pertaining to the logged record. May be a temporary id before /// the channel has been funded. @@ -250,11 +254,11 @@ mod tests { } struct WrapperLog { - logger: Arc + logger: Arc } impl WrapperLog { - fn new(logger: Arc) -> WrapperLog { + fn new(logger: Arc) -> WrapperLog { WrapperLog { logger, } @@ -274,7 +278,7 @@ mod tests { fn test_logging_macros() { let mut logger = TestLogger::new(); logger.enable(Level::Gossip); - let logger : Arc = Arc::new(logger); + let logger : Arc = Arc::new(logger); let wrapper = WrapperLog::new(Arc::clone(&logger)); wrapper.call_macros(); }