+pub(crate) struct DebugSpendable<'a>(pub &'a SpendableOutputDescriptor);
+impl<'a> core::fmt::Display for DebugSpendable<'a> {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
+ match self.0 {
+ &SpendableOutputDescriptor::StaticOutput { ref outpoint, .. } => {
+ write!(f, "StaticOutput {}:{} marked for spending", outpoint.txid, outpoint.index)?;
+ }
+ &SpendableOutputDescriptor::DelayedPaymentOutput(ref descriptor) => {
+ write!(f, "DelayedPaymentOutput {}:{} marked for spending", descriptor.outpoint.txid, descriptor.outpoint.index)?;
+ }
+ &SpendableOutputDescriptor::StaticPaymentOutput(ref descriptor) => {
+ write!(f, "DynamicOutputP2WPKH {}:{} marked for spending", descriptor.outpoint.txid, descriptor.outpoint.index)?;
+ }
+ }
+ Ok(())
+ }
+}
+
+macro_rules! log_spendable {
+ ($obj: expr) => {
+ ::util::macro_logger::DebugSpendable(&$obj)
+ }
+}
+
+/// Create a new Record and log it. You probably don't want to use this macro directly,
+/// but it needs to be exported so `log_trace` etc can use it in external crates.
+#[macro_export]