Skip to content

Commit

Permalink
feat: reduce universe spam logs (#6540)
Browse files Browse the repository at this point in the history
Description
---
Reduce universe spam logs

Motivation and Context
---
To much spam logs

How Has This Been Tested?
---
Unit tests

What process can a PR reviewer use to test or verify this change?
---
Code review

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
hansieodendaal authored Sep 9, 2024
1 parent 825ca06 commit 4c246b8
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions applications/minotari_console_wallet/log4rs_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ loggers:
additive: false
# network
comms:
level: info
level: debug
appenders:
- network
additive: false
Expand All @@ -144,7 +144,7 @@ loggers:
- network
additive: false
p2p:
level: info
level: debug
appenders:
- network
# Route log events sent to the "mio" logger to the "other" appender
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ where B: BlockchainBackend + 'static
/// Handle inbound node comms requests from remote nodes and local services.
#[allow(clippy::too_many_lines)]
pub async fn handle_request(&self, request: NodeCommsRequest) -> Result<NodeCommsResponse, CommsInterfaceError> {
debug!(target: LOG_TARGET, "Handling remote request {}", request);
trace!(target: LOG_TARGET, "Handling remote request {}", request);
match request {
NodeCommsRequest::GetChainMetadata => Ok(NodeCommsResponse::ChainMetadata(
self.blockchain_db.get_chain_metadata().await?,
Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/mempool/service/inbound_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl MempoolInboundHandlers {

/// Handle inbound Mempool service requests from remote nodes and local services.
pub async fn handle_request(&mut self, request: MempoolRequest) -> Result<MempoolResponse, MempoolServiceError> {
debug!(target: LOG_TARGET, "Handling remote request: {}", request);
trace!(target: LOG_TARGET, "Handling remote request: {}", request);
use MempoolRequest::{GetFeePerGramStats, GetState, GetStats, GetTxStateByExcessSig, SubmitTransaction};
match request {
GetStats => Ok(MempoolResponse::Stats(self.mempool.stats().await?)),
Expand Down
2 changes: 1 addition & 1 deletion base_layer/p2p/src/services/liveness/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ where
.collect::<Vec<_>>();

if selected_peers.is_empty() {
info!(
debug!(
target: LOG_TARGET,
"Cannot broadcast pings because there are no broadcast peers available"
)
Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet/src/base_node_service/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ where
})
.await;

debug!(
trace!(
target: LOG_TARGET,
"Base node {} Tip: {} ({}) Latency: {} ms",
base_node_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,18 @@ pub async fn check_detected_transactions<TBackend: 'static + TransactionBackend>
let must_be_confirmed =
tip_height.saturating_sub(mined_height) >= TransactionServiceConfig::default().num_confirmations_required;
let num_confirmations = tip_height.saturating_sub(mined_height);
debug!(
target: LOG_TARGET,

let log_msg = format!(
"Updating faux transaction: TxId({}), mined_height({}), must_be_confirmed({}), num_confirmations({}), \
output_status({}), is_valid({})",
tx.tx_id,
mined_height,
must_be_confirmed,
num_confirmations,
output_status,
is_valid,
tx.tx_id, mined_height, must_be_confirmed, num_confirmations, output_status, is_valid
);
if num_confirmations <= 5 {
debug!(target: LOG_TARGET, "{}", log_msg);
} else {
trace!(target: LOG_TARGET, "{}", log_msg);
}

let result = db.set_transaction_mined_height(
tx.tx_id,
mined_height,
Expand Down
4 changes: 2 additions & 2 deletions comms/core/src/protocol/rpc/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ where
return Err(err);
}
let elapsed = start.elapsed();
debug!(
trace!(
target: LOG_TARGET,
"({}) RPC request completed in {:.0?}{}",
self.logging_context_string,
Expand Down Expand Up @@ -671,7 +671,7 @@ where
return Ok(());
}

debug!(
trace!(
target: LOG_TARGET,
"({}) Request: {}, Method: {}",
self.logging_context_string,
Expand Down
2 changes: 1 addition & 1 deletion comms/dht/src/connectivity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ impl DhtConnectivity {
.await?;

if new_neighbours.is_empty() {
info!(
debug!(
target: LOG_TARGET,
"Unable to refresh neighbouring peer pool because there are insufficient known/online peers",
);
Expand Down

0 comments on commit 4c246b8

Please sign in to comment.