mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
sc-executor: Improve logging (#10869)
Improves the logging by switching to `tracing` for a better log output. Besides that, it also adds a trace for the function being executed.
This commit is contained in:
@@ -103,23 +103,23 @@ impl VersionedRuntime {
|
||||
let result = f(&self.module, &mut *instance, self.version.as_ref(), ext);
|
||||
if let Err(e) = &result {
|
||||
if new_inst {
|
||||
log::warn!(
|
||||
tracing::warn!(
|
||||
target: "wasm-runtime",
|
||||
"Fresh runtime instance failed with {}",
|
||||
e,
|
||||
error = %e,
|
||||
"Fresh runtime instance failed",
|
||||
)
|
||||
} else {
|
||||
log::warn!(
|
||||
tracing::warn!(
|
||||
target: "wasm-runtime",
|
||||
"Evicting failed runtime instance: {}",
|
||||
e,
|
||||
error = %e,
|
||||
"Evicting failed runtime instance",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
*locked = Some(instance);
|
||||
|
||||
if new_inst {
|
||||
log::debug!(
|
||||
tracing::debug!(
|
||||
target: "wasm-runtime",
|
||||
"Allocated WASM instance {}/{}",
|
||||
index + 1,
|
||||
@@ -131,7 +131,7 @@ impl VersionedRuntime {
|
||||
result
|
||||
},
|
||||
None => {
|
||||
log::warn!(target: "wasm-runtime", "Ran out of free WASM instances");
|
||||
tracing::warn!(target: "wasm-runtime", "Ran out of free WASM instances");
|
||||
|
||||
// Allocate a new instance
|
||||
let mut instance = self.module.new_instance()?;
|
||||
@@ -259,7 +259,7 @@ impl RuntimeCache {
|
||||
|
||||
match result {
|
||||
Ok(ref result) => {
|
||||
log::debug!(
|
||||
tracing::debug!(
|
||||
target: "wasm-runtime",
|
||||
"Prepared new runtime version {:?} in {} ms.",
|
||||
result.version,
|
||||
@@ -267,7 +267,7 @@ impl RuntimeCache {
|
||||
);
|
||||
},
|
||||
Err(ref err) => {
|
||||
log::warn!(target: "wasm-runtime", "Cannot create a runtime: {:?}", err);
|
||||
tracing::warn!(target: "wasm-runtime", error = ?err, "Cannot create a runtime");
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user