From 5e19269124ef41296b16e37d860d597d66830c40 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 15 Aug 2025 16:05:57 +0100 Subject: [PATCH] Improve geth stdout logging on failure --- crates/node/src/geth.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/node/src/geth.rs b/crates/node/src/geth.rs index 9268465..8c194d3 100644 --- a/crates/node/src/geth.rs +++ b/crates/node/src/geth.rs @@ -213,8 +213,10 @@ impl GethNode { let maximum_wait_time = Duration::from_millis(self.start_timeout); let mut stderr = BufReader::new(logs_file).lines(); + let mut lines = vec![]; loop { if let Some(Ok(line)) = stderr.next() { + lines.push(line); if line.contains(Self::ERROR_MARKER) { anyhow::bail!("Failed to start geth {line}"); } @@ -224,8 +226,9 @@ impl GethNode { } if Instant::now().duration_since(start_time) > maximum_wait_time { anyhow::bail!( - "Timeout in starting geth: took longer than {}ms", - self.start_timeout + "Timeout in starting geth: took longer than {}ms. stdout:\n\n{}\n", + self.start_timeout, + lines.join("\n") ); } }