From e20975136ed9a07446516039593640428427b9b0 Mon Sep 17 00:00:00 2001 From: Simon B Date: Sat, 18 Nov 2017 21:34:05 +0100 Subject: [PATCH] less chatty Testnet1 outputs (#316) Fixes #281 by doing: - "Starting validation pipeline for " -> "Processing " - stdout logging default = Warning - ERR -> INFO for "Transaction rejected: Already in pool" -- only for netadapter transaction_received, which (hopefully!) only gets tx from peers, and lots of those will be duplicates, that's good and not an error. * Downgrade ERR even down to DEBUG. Also let Transaction rejected show tx hash, so users can check if such a rejection is for the payment they expected, or just any random peer sending in some old and already known tx. --- chain/src/pipe.rs | 8 ++++---- grin.toml | 2 +- grin/src/adapters.rs | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index 3e6e0730..8a21d647 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -51,9 +51,9 @@ pub fn process_block(b: &Block, mut ctx: BlockContext) -> Result, Er // TODO should just take a promise for a block with a full header so we don't // spend resources reading the full block when its header is invalid - info!( + debug!( LOGGER, - "Starting validation pipeline for block {} at {} with {} inputs and {} outputs.", + "Processing block {} at {} with {} inputs and {} outputs.", b.hash(), b.header.height, b.inputs.len(), @@ -94,9 +94,9 @@ pub fn process_block(b: &Block, mut ctx: BlockContext) -> Result, Er /// Process the block header pub fn process_block_header(bh: &BlockHeader, mut ctx: BlockContext) -> Result, Error> { - info!( + debug!( LOGGER, - "Starting validation pipeline for block header {} at {}.", + "Processing header {} at {}.", bh.hash(), bh.height ); diff --git a/grin.toml b/grin.toml index a65e071a..276e2fec 100644 --- a/grin.toml +++ b/grin.toml @@ -63,7 +63,7 @@ port = 13414 log_to_stdout = true # Log level for stdout: Critical, Error, Warning, Info, Debug, Trace -stdout_log_level = "Debug" +stdout_log_level = "Warning" # Whether to log to a file log_to_file = true diff --git a/grin/src/adapters.rs b/grin/src/adapters.rs index b665dac9..3dcfa79f 100644 --- a/grin/src/adapters.rs +++ b/grin/src/adapters.rs @@ -57,8 +57,9 @@ impl NetAdapter for NetToChainAdapter { source.identifier, ); + let h = tx.hash(); if let Err(e) = self.tx_pool.write().unwrap().add_to_memory_pool(source, tx) { - error!(LOGGER, "Transaction rejected: {:?}", e); + debug!(LOGGER, "Transaction {} rejected: {:?}", h, e); } }