mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
rpc-author: Downgrade the logging level of some logs (#10483)
* rpc-author: Downgrade the logging level of some logs Currently these messages are printed with `warn` levels, but they don't bring the node operator anything. The problem with these log lines is that they are triggered by external users when they send invalid transactions. This pr "resolves" this by downgrading the log severity to debug, aka not shown by default. * FMT
This commit is contained in:
@@ -21,7 +21,6 @@
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use log::warn;
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
|
||||
use sp_blockchain::HeaderBackend;
|
||||
@@ -188,7 +187,7 @@ where
|
||||
let dxt = match TransactionFor::<P>::decode(&mut &xt[..]).map_err(error::Error::from) {
|
||||
Ok(tx) => tx,
|
||||
Err(err) => {
|
||||
warn!("Failed to submit extrinsic: {}", err);
|
||||
log::debug!("Failed to submit extrinsic: {}", err);
|
||||
// reject the subscriber (ignore errors - we don't care if subscriber is no longer
|
||||
// there).
|
||||
let _ = subscriber.reject(err.into());
|
||||
@@ -211,7 +210,7 @@ where
|
||||
let tx_stream = match submit.await {
|
||||
Ok(s) => s,
|
||||
Err(err) => {
|
||||
warn!("Failed to submit extrinsic: {}", err);
|
||||
log::debug!("Failed to submit extrinsic: {}", err);
|
||||
// reject the subscriber (ignore errors - we don't care if subscriber is no
|
||||
// longer there).
|
||||
let _ = subscriber.reject(err.into());
|
||||
@@ -222,14 +221,16 @@ where
|
||||
subscriptions.add(subscriber, move |sink| {
|
||||
tx_stream
|
||||
.map(|v| Ok(Ok(v)))
|
||||
.forward(sink.sink_map_err(|e| warn!("Error sending notifications: {:?}", e)))
|
||||
.forward(
|
||||
sink.sink_map_err(|e| log::debug!("Error sending notifications: {:?}", e)),
|
||||
)
|
||||
.map(drop)
|
||||
});
|
||||
};
|
||||
|
||||
let res = self.subscriptions.executor().spawn_obj(future.boxed().into());
|
||||
if res.is_err() {
|
||||
warn!("Error spawning subscription RPC task.");
|
||||
log::warn!("Error spawning subscription RPC task.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user