From 9bf6b817f964cf171e38b75658c2a7c27767af7a Mon Sep 17 00:00:00 2001 From: Alice Hau Date: Mon, 6 Jan 2025 20:12:21 -0500 Subject: [PATCH] fix log levels --- crates/goose-cli/src/logging.rs | 2 -- crates/goose-cli/src/main.rs | 2 +- crates/goose-server/src/logging.rs | 8 ++++---- crates/goose/src/agent.rs | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/crates/goose-cli/src/logging.rs b/crates/goose-cli/src/logging.rs index 6d5fe6d9..e1b915f3 100644 --- a/crates/goose-cli/src/logging.rs +++ b/crates/goose-cli/src/logging.rs @@ -73,9 +73,7 @@ pub fn setup_logging() -> Result<()> { let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| { // Set default levels for different modules EnvFilter::new("") - // Set goose module to INFO only .add_directive("goose=debug".parse().unwrap()) - // Set goose-cli to INFO .add_directive("goose_cli=info".parse().unwrap()) // Set everything else to WARN .add_directive(LevelFilter::WARN.into()) diff --git a/crates/goose-cli/src/main.rs b/crates/goose-cli/src/main.rs index 921a0f12..fc5753ac 100644 --- a/crates/goose-cli/src/main.rs +++ b/crates/goose-cli/src/main.rs @@ -197,7 +197,7 @@ enum CliProviderVariant { #[tokio::main] async fn main() -> Result<()> { - setup_logging(); + setup_logging()?; let cli = Cli::parse(); diff --git a/crates/goose-server/src/logging.rs b/crates/goose-server/src/logging.rs index 724c7c41..246e1bb3 100644 --- a/crates/goose-server/src/logging.rs +++ b/crates/goose-server/src/logging.rs @@ -72,8 +72,8 @@ pub fn setup_logging() -> Result<()> { let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| { // Set default levels for different modules EnvFilter::new("") - // Set goose module to INFO only - .add_directive("goose=info".parse().unwrap()) + // Set goose module to INFO only, but allow ERROR level for all submodules + .add_directive("goose=debug".parse().unwrap()) // Set goose-server to INFO .add_directive("goose_server=info".parse().unwrap()) // Set tower-http to INFO for request logging @@ -84,8 +84,8 @@ pub fn setup_logging() -> Result<()> { // Build the subscriber with required layers let subscriber = Registry::default() - .with(file_layer) - .with(console_layer.with_filter(env_filter)); + .with(file_layer.with_filter(env_filter)) + .with(console_layer.with_filter(LevelFilter::INFO)); // Initialize with Langfuse if available if let Some(langfuse) = langfuse_layer::create_langfuse_observer() { diff --git a/crates/goose/src/agent.rs b/crates/goose/src/agent.rs index 86064080..76dfb2af 100644 --- a/crates/goose/src/agent.rs +++ b/crates/goose/src/agent.rs @@ -412,8 +412,6 @@ impl Agent { let outputs = futures::future::join_all(futures) .await; - debug!("All tool requests completed"); - // Create a message with the responses let mut message_tool_response = Message::user(); // Now combine these into MessageContent::ToolResponse using the original ID