From 2ea296fb8b7994e4c64cf57c3ccdaf3af5d2b73c Mon Sep 17 00:00:00 2001 From: adrian Date: Fri, 12 Sep 2025 08:59:48 +0200 Subject: [PATCH] fix: pass RUST_LOG down to tycho-indexer --- protocol-testing/docker-compose.yaml | 2 +- protocol-testing/src/tycho_runner.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/protocol-testing/docker-compose.yaml b/protocol-testing/docker-compose.yaml index e58e36a..4467c0a 100644 --- a/protocol-testing/docker-compose.yaml +++ b/protocol-testing/docker-compose.yaml @@ -28,7 +28,7 @@ services: db: condition: service_healthy environment: - RUST_LOG: "info" + RUST_LOG: "protocol_testing=info" DATABASE_URL: postgres://postgres:mypassword@db:5432/tycho_indexer_0 RPC_URL: "${RPC_URL}" SUBSTREAMS_API_TOKEN: "${SUBSTREAMS_API_TOKEN}" diff --git a/protocol-testing/src/tycho_runner.rs b/protocol-testing/src/tycho_runner.rs index 7a162c2..84a56ba 100644 --- a/protocol-testing/src/tycho_runner.rs +++ b/protocol-testing/src/tycho_runner.rs @@ -37,7 +37,7 @@ impl TychoRunner { dotenv().ok(); let mut cmd = Command::new("tycho-indexer"); - cmd.env("RUST_LOG", "tycho_indexer=info"); + cmd.env("RUST_LOG", std::env::var("RUST_LOG").unwrap_or("tycho_indexer=info".to_string())); let all_accounts = self.initialized_accounts.clone(); @@ -113,13 +113,14 @@ impl TychoRunner { // Start the RPC server in a separate thread let rpc_thread = thread::spawn(move || { - let binary_path = "tycho-indexer"; - - let mut cmd = Command::new(binary_path) + let mut cmd = Command::new("tycho-indexer") .args(["--database-url", db_url.as_str(), "rpc"]) .stdout(Stdio::piped()) .stderr(Stdio::piped()) - .env("RUST_LOG", "info") + .env( + "RUST_LOG", + std::env::var("RUST_LOG").unwrap_or("tycho_indexer=info".to_string()), + ) .spawn() .expect("Failed to start RPC server");