mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 01:07:57 +00:00
Improve tracing (#5698)
* Improve tracing implementation * Enable tracing in runtime interfaces * Switch to `TRACE` level
This commit is contained in:
@@ -1030,12 +1030,7 @@ macro_rules! decl_module {
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_initialize(_block_number_not_used: $trait_instance::BlockNumber) -> $return {
|
||||
use $crate::sp_std::if_std;
|
||||
if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, "on_initialize");
|
||||
let _enter = span.enter();
|
||||
}
|
||||
$crate::sp_tracing::enter_span!("on_initialize");
|
||||
{ $( $impl )* }
|
||||
}
|
||||
}
|
||||
@@ -1051,12 +1046,7 @@ macro_rules! decl_module {
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_initialize($param: $param_ty) -> $return {
|
||||
use $crate::sp_std::if_std;
|
||||
if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, "on_initialize");
|
||||
let _enter = span.enter();
|
||||
}
|
||||
$crate::sp_tracing::enter_span!("on_initialize");
|
||||
{ $( $impl )* }
|
||||
}
|
||||
}
|
||||
@@ -1082,12 +1072,7 @@ macro_rules! decl_module {
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_runtime_upgrade() -> $return {
|
||||
use $crate::sp_std::if_std;
|
||||
if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, "on_runtime_upgrade");
|
||||
let _enter = span.enter();
|
||||
}
|
||||
$crate::sp_tracing::enter_span!("on_runtime_upgrade");
|
||||
{ $( $impl )* }
|
||||
}
|
||||
}
|
||||
@@ -1114,12 +1099,7 @@ macro_rules! decl_module {
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_finalize(_block_number_not_used: $trait_instance::BlockNumber) {
|
||||
use $crate::sp_std::if_std;
|
||||
if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, "on_finalize");
|
||||
let _enter = span.enter();
|
||||
}
|
||||
$crate::sp_tracing::enter_span!("on_finalize");
|
||||
{ $( $impl )* }
|
||||
}
|
||||
}
|
||||
@@ -1135,12 +1115,7 @@ macro_rules! decl_module {
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_finalize($param: $param_ty) {
|
||||
use $crate::sp_std::if_std;
|
||||
if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, "on_finalize");
|
||||
let _enter = span.enter();
|
||||
}
|
||||
$crate::sp_tracing::enter_span!("on_finalize");
|
||||
{ $( $impl )* }
|
||||
}
|
||||
}
|
||||
@@ -1209,15 +1184,9 @@ macro_rules! decl_module {
|
||||
$vis fn $name(
|
||||
$origin: $origin_ty $(, $param: $param_ty )*
|
||||
) -> $crate::dispatch::DispatchResult {
|
||||
$crate::sp_std::if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, stringify!($name));
|
||||
let _enter = span.enter();
|
||||
}
|
||||
{
|
||||
{ $( $impl )* }
|
||||
Ok(())
|
||||
}
|
||||
$crate::sp_tracing::enter_span!(stringify!($name));
|
||||
{ $( $impl )* }
|
||||
Ok(())
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1234,13 +1203,8 @@ macro_rules! decl_module {
|
||||
) => {
|
||||
$(#[doc = $doc_attr])*
|
||||
$vis fn $name($origin: $origin_ty $(, $param: $param_ty )* ) -> $result {
|
||||
use $crate::sp_std::if_std;
|
||||
if_std! {
|
||||
use $crate::tracing;
|
||||
let span = tracing::span!(tracing::Level::DEBUG, stringify!($name));
|
||||
let _enter = span.enter();
|
||||
}
|
||||
{ $( $impl )* }
|
||||
$crate::sp_tracing::enter_span!(stringify!($name));
|
||||
$( $impl )*
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user