mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +00:00
Improve tracing (#5698)
* Improve tracing implementation * Enable tracing in runtime interfaces * Switch to `TRACE` level
This commit is contained in:
+2
@@ -146,6 +146,7 @@ fn function_std_impl(
|
||||
is_wasm_only: bool,
|
||||
) -> Result<TokenStream> {
|
||||
let function_name = create_function_ident_with_version(&method.sig.ident, version);
|
||||
let function_name_str = function_name.to_string();
|
||||
|
||||
let crate_ = generate_crate_access();
|
||||
let args = get_function_arguments(&method.sig).map(FnArg::Typed).chain(
|
||||
@@ -172,6 +173,7 @@ fn function_std_impl(
|
||||
#[cfg(feature = "std")]
|
||||
#( #attrs )*
|
||||
fn #function_name( #( #args, )* ) #return_value {
|
||||
#crate_::sp_tracing::enter_span!(#function_name_str);
|
||||
#call_to_trait
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -226,6 +226,7 @@ fn generate_host_function_implementation(
|
||||
__function_context__: &mut dyn #crate_::sp_wasm_interface::FunctionContext,
|
||||
args: &mut dyn Iterator<Item = #crate_::sp_wasm_interface::Value>,
|
||||
) -> std::result::Result<Option<#crate_::sp_wasm_interface::Value>, String> {
|
||||
#crate_::sp_tracing::enter_span!(#name);
|
||||
#( #wasm_to_ffi_values )*
|
||||
#( #ffi_to_host_values )*
|
||||
#host_function_call
|
||||
|
||||
Reference in New Issue
Block a user