Correct async `lightning-background-processor` exit check docs
[rust-lightning] / lightning / src / util / macro_logger.rs
index 01a0d3ff45f192b4744a8d9ef20eb614bf3f169d..8c2aba0c1c1cf87ac15ec95076a3a5cc05ea1330 100644 (file)
@@ -7,29 +7,21 @@
 // You may not use this file except in accordance with one or both of these
 // licenses.
 
-use chain::transaction::OutPoint;
-use chain::keysinterface::SpendableOutputDescriptor;
+use crate::chain::transaction::OutPoint;
+use crate::chain::keysinterface::SpendableOutputDescriptor;
 
 use bitcoin::hash_types::Txid;
 use bitcoin::blockdata::transaction::Transaction;
-use bitcoin::secp256k1::PublicKey;
 
-use routing::router::Route;
-use ln::chan_utils::HTLCClaim;
-use util::logger::DebugBytes;
+use crate::routing::router::Route;
+use crate::ln::chan_utils::HTLCClaim;
+use crate::util::logger::DebugBytes;
 
-pub(crate) struct DebugPubKey<'a>(pub &'a PublicKey);
-impl<'a> core::fmt::Display for DebugPubKey<'a> {
-       fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
-               for i in self.0.serialize().iter() {
-                       write!(f, "{:02x}", i)?;
-               }
-               Ok(())
-       }
-}
+/// Logs a pubkey in hex format.
+#[macro_export]
 macro_rules! log_pubkey {
        ($obj: expr) => {
-               ::util::macro_logger::DebugPubKey(&$obj)
+               $crate::util::logger::DebugPubKey(&$obj)
        }
 }
 
@@ -52,7 +44,7 @@ impl<'a> core::fmt::Display for DebugFundingChannelId<'a> {
 }
 macro_rules! log_funding_channel_id {
        ($funding_txid: expr, $funding_txo: expr) => {
-               ::util::macro_logger::DebugFundingChannelId(&$funding_txid, $funding_txo)
+               $crate::util::macro_logger::DebugFundingChannelId(&$funding_txid, $funding_txo)
        }
 }
 
@@ -64,7 +56,7 @@ impl<'a, T> core::fmt::Display for DebugFundingInfo<'a, T> {
 }
 macro_rules! log_funding_info {
        ($key_storage: expr) => {
-               ::util::macro_logger::DebugFundingInfo(&$key_storage.get_funding_txo())
+               $crate::util::macro_logger::DebugFundingInfo(&$key_storage.get_funding_txo())
        }
 }
 
@@ -82,7 +74,7 @@ impl<'a> core::fmt::Display for DebugRoute<'a> {
 }
 macro_rules! log_route {
        ($obj: expr) => {
-               ::util::macro_logger::DebugRoute(&$obj)
+               $crate::util::macro_logger::DebugRoute(&$obj)
        }
 }
 
@@ -130,7 +122,7 @@ impl<'a> core::fmt::Display for DebugTx<'a> {
 
 macro_rules! log_tx {
        ($obj: expr) => {
-               ::util::macro_logger::DebugTx(&$obj)
+               $crate::util::macro_logger::DebugTx(&$obj)
        }
 }
 
@@ -154,7 +146,7 @@ impl<'a> core::fmt::Display for DebugSpendable<'a> {
 
 macro_rules! log_spendable {
        ($obj: expr) => {
-               ::util::macro_logger::DebugSpendable(&$obj)
+               $crate::util::macro_logger::DebugSpendable(&$obj)
        }
 }