sc_transaction_pool/common/
tracing_log_xt.rs1macro_rules! log_xt {
23 (data: hash, target: $target:expr, $level:expr, $tx_collection:expr, $text_with_format:expr) => {
24 for tx_hash in $tx_collection {
25 tracing::event!(
26 target: $target,
27 $level,
28 ?tx_hash,
29 $text_with_format,
30 );
31 }
32 };
33 (data: hash, target: $target:expr, $level:expr, $tx_collection:expr, $text_with_format:expr, $($arg:expr),*) => {
34 for tx_hash in $tx_collection {
35 tracing::event!(
36 target: $target,
37 $level,
38 ?tx_hash,
39 $text_with_format,
40 $($arg),*
41 );
42 }
43 };
44 (data: tuple, target: $target:expr, $level:expr, $tx_collection:expr, $text_with_format:expr) => {
45 for (tx_hash, arg) in $tx_collection {
46 tracing::event!(
47 target: $target,
48 $level,
49 ?tx_hash,
50 $text_with_format,
51 arg
52 );
53 }
54 };
55}
56macro_rules! log_xt_debug {
57 (data: $datatype:ident, target: $target:expr, $($arg:tt)+) => {
58 $crate::common::tracing_log_xt::log_xt!(data: $datatype, target: $target, tracing::Level::DEBUG, $($arg)+);
59 };
60 (target: $target:expr, $tx_collection:expr, $text_with_format:expr) => {
61 $crate::common::tracing_log_xt::log_xt!(data: hash, target: $target, tracing::Level::DEBUG, $tx_collection, $text_with_format);
62 };
63 (target: $target:expr, $tx_collection:expr, $text_with_format:expr, $($arg:expr)*) => {
64 $crate::common::tracing_log_xt::log_xt!(data: hash, target: $target, tracing::Level::DEBUG, $tx_collection, $text_with_format, $($arg)*);
65 };
66}
67
68macro_rules! log_xt_trace {
69 (data: $datatype:ident, target: $target:expr, $($arg:tt)+) => {
70 $crate::common::tracing_log_xt::log_xt!(data: $datatype, target: $target, tracing::Level::TRACE, $($arg)+);
71 };
72 (target: $target:expr, $tx_collection:expr, $text_with_format:expr) => {
73 $crate::common::tracing_log_xt::log_xt!(data: hash, target: $target, tracing::Level::TRACE, $tx_collection, $text_with_format);
74 };
75 (target: $target:expr, $tx_collection:expr, $text_with_format:expr, $($arg:expr)*) => {
76 $crate::common::tracing_log_xt::log_xt!(data: hash, target: $target, tracing::Level::TRACE, $tx_collection, $text_with_format, $($arg)*);
77 };
78}
79
80pub(crate) use log_xt;
81pub(crate) use log_xt_debug;
82pub(crate) use log_xt_trace;