Convert all INFO logs to DEBUG to reduce CLI noise

Converted ~77 info! macro calls to debug! across the codebase to prevent
log messages from interrupting the CLI experience during normal operation.
Users can still see these logs by setting RUST_LOG=debug if needed.

Affected crates:
- g3-cli
- g3-computer-control
- g3-console
- g3-core
- g3-ensembles
- g3-execution
- g3-providers
This commit is contained in:
Dhanji R. Prasanna
2025-12-22 16:27:35 +11:00
parent 58cbf3431a
commit 923def0ab2
19 changed files with 92 additions and 92 deletions

View File

@@ -9,7 +9,7 @@
use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::time::Duration;
use tracing::{error, info, warn};
use tracing::{debug, error, warn};
/// Base delay for exponential backoff (in milliseconds)
const BASE_RETRY_DELAY_MS: u64 = 1000;
@@ -149,7 +149,7 @@ impl ErrorContext {
if let Err(e) = std::fs::write(&filename, json_content) {
error!("Failed to save error context to {:?}: {}", &filename, e);
} else {
info!("Error details saved to: {:?}", &filename);
debug!("Error details saved to: {:?}", &filename);
}
}
Err(e) => {
@@ -328,7 +328,7 @@ where
match operation().await {
Ok(result) => {
if attempt > 1 {
info!(
debug!(
"Operation '{}' succeeded after {} attempts",
operation_name, attempt
);
@@ -357,7 +357,7 @@ where
// Special handling for token limit errors
if matches!(recoverable_type, RecoverableError::TokenLimit) {
info!("Token limit error detected. Consider triggering summarization.");
debug!("Token limit error detected. Consider triggering summarization.");
}
tokio::time::sleep(delay).await;

View File

@@ -12,7 +12,7 @@ use crate::{logs_dir, Agent, TaskResult};
use crate::ui_writer::UiWriter;
use serde_json::Value;
use std::path::PathBuf;
use tracing::{debug, info, warn};
use tracing::{debug, warn};
/// Result of feedback extraction with source information
#[derive(Debug, Clone)]
@@ -103,21 +103,21 @@ where
// Try session log first (most reliable)
if let Some(session_id) = agent.get_session_id() {
if let Some(feedback) = try_extract_from_session_log(&session_id, config) {
info!("Extracted coach feedback from session log: {} chars", feedback.len());
debug!("Extracted coach feedback from session log: {} chars", feedback.len());
return ExtractedFeedback::new(feedback, FeedbackSource::SessionLog);
}
}
// Try native tool call JSON parsing
if let Some(feedback) = try_extract_from_native_tool_call(&coach_result.response) {
info!("Extracted coach feedback from native tool call: {} chars", feedback.len());
debug!("Extracted coach feedback from native tool call: {} chars", feedback.len());
return ExtractedFeedback::new(feedback, FeedbackSource::NativeToolCall);
}
// Try conversation history
if let Some(session_id) = agent.get_session_id() {
if let Some(feedback) = try_extract_from_conversation_history(&session_id, config) {
info!("Extracted coach feedback from conversation history: {} chars", feedback.len());
debug!("Extracted coach feedback from conversation history: {} chars", feedback.len());
return ExtractedFeedback::new(feedback, FeedbackSource::ConversationHistory);
}
}
@@ -125,7 +125,7 @@ where
// Try TaskResult parsing
let extracted = coach_result.extract_final_output();
if !extracted.is_empty() {
info!("Extracted coach feedback from task result: {} chars", extracted.len());
debug!("Extracted coach feedback from task result: {} chars", extracted.len());
return ExtractedFeedback::new(extracted, FeedbackSource::TaskResultResponse);
}

View File

@@ -39,7 +39,7 @@ use serde_json::json;
use std::io::Write;
use std::time::{Duration, Instant};
use tokio_util::sync::CancellationToken;
use tracing::{debug, error, info, warn};
use tracing::{debug, error, warn};
/// Get the path to the todo.g3.md file.
///
@@ -2778,7 +2778,7 @@ impl<W: UiWriter> Agent<W> {
/// Manually trigger context summarization regardless of context window size
/// Returns Ok(true) if summarization was successful, Ok(false) if it failed
pub async fn force_summarize(&mut self) -> Result<bool> {
info!("Manual summarization triggered");
debug!("Manual summarization triggered");
self.ui_writer.print_context_status(&format!(
"\n🗜️ Manual summarization requested (current usage: {}%)...",
@@ -2896,7 +2896,7 @@ impl<W: UiWriter> Agent<W> {
/// Manually trigger context thinning regardless of thresholds
pub fn force_thin(&mut self) -> String {
info!("Manual context thinning triggered");
debug!("Manual context thinning triggered");
let (message, chars_saved) = self.context_window.thin_context(self.session_id.as_deref());
self.thinning_events.push(chars_saved);
message
@@ -2905,7 +2905,7 @@ impl<W: UiWriter> Agent<W> {
/// Manually trigger context thinning for the ENTIRE context window
/// Unlike force_thin which only processes the first third, this processes all messages
pub fn force_thin_all(&mut self) -> String {
info!("Manual full context skinnifying triggered");
debug!("Manual full context skinnifying triggered");
let (message, chars_saved) = self.context_window.thin_context_all(self.session_id.as_deref());
self.thinning_events.push(chars_saved);
message
@@ -2914,7 +2914,7 @@ impl<W: UiWriter> Agent<W> {
/// Reload README.md and AGENTS.md and replace the first system message
/// Returns Ok(true) if README was found and reloaded, Ok(false) if no README was present initially
pub fn reload_readme(&mut self) -> Result<bool> {
info!("Manual README reload triggered");
debug!("Manual README reload triggered");
// Check if the second message in conversation history is a system message with README content
// (The first message should always be the system prompt)
@@ -2957,7 +2957,7 @@ impl<W: UiWriter> Agent<W> {
// Replace the second message (README) with the new content
if let Some(first_msg) = self.context_window.conversation_history.get_mut(1) {
first_msg.content = combined_content;
info!("README content reloaded successfully");
debug!("README content reloaded successfully");
Ok(true)
} else {
Ok(false)
@@ -3191,7 +3191,7 @@ impl<W: UiWriter> Agent<W> {
error!("Failed to clear continuation artifacts: {}", e);
}
info!("Session cleared");
debug!("Session cleared");
}
/// Restore session from a continuation artifact
@@ -3236,7 +3236,7 @@ impl<W: UiWriter> Agent<W> {
});
}
info!("Restored full context from session log");
debug!("Restored full context from session log");
return Ok(true);
}
}
@@ -3261,7 +3261,7 @@ impl<W: UiWriter> Agent<W> {
});
}
info!("Restored session from summary");
debug!("Restored session from summary");
Ok(false)
}
@@ -3871,7 +3871,7 @@ impl<W: UiWriter> Agent<W> {
match provider.stream(request.clone()).await {
Ok(stream) => {
if attempt > 1 {
info!("Stream started successfully after {} attempts", attempt);
debug!("Stream started successfully after {} attempts", attempt);
}
debug!("Stream started successfully");
debug!(
@@ -6559,7 +6559,7 @@ impl<W: UiWriter> Agent<W> {
let driver = mutex.into_inner();
match driver.quit().await {
Ok(_) => {
info!("WebDriver session closed successfully");
debug!("WebDriver session closed successfully");
// Kill the safaridriver process
if let Some(mut process) =
@@ -6568,7 +6568,7 @@ impl<W: UiWriter> Agent<W> {
if let Err(e) = process.kill().await {
warn!("Failed to kill safaridriver process: {}", e);
} else {
info!("Safaridriver process terminated");
debug!("Safaridriver process terminated");
}
}

View File

@@ -10,7 +10,7 @@ use crate::ui_writer::UiWriter;
use crate::{Agent, DiscoveryOptions, TaskResult};
use anyhow::Result;
use std::time::Instant;
use tracing::{info, warn};
use tracing::{debug, warn};
/// Configuration for retry behavior
#[derive(Debug, Clone)]
@@ -142,7 +142,7 @@ where
match result {
Ok(task_result) => {
if retry_count > 0 {
info!(
debug!(
"{} task succeeded after {} retries (elapsed: {:?})",
config.role_name,
retry_count,
@@ -259,7 +259,7 @@ where
match operation().await {
Ok(result) => {
if retry_count > 0 {
info!(
debug!(
"Operation '{}' succeeded after {} retries",
operation_name, retry_count
);

View File

@@ -6,7 +6,7 @@
use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
use tracing::{debug, error, info, warn};
use tracing::{debug, error, warn};
/// Version of the session continuation format
const CONTINUATION_VERSION: &str = "1.0";
@@ -89,7 +89,7 @@ pub fn save_continuation(continuation: &SessionContinuation) -> Result<PathBuf>
let json = serde_json::to_string_pretty(continuation)?;
std::fs::write(&latest_path, &json)?;
info!("Saved session continuation to {:?}", latest_path);
debug!("Saved session continuation to {:?}", latest_path);
Ok(latest_path)
}
@@ -113,7 +113,7 @@ pub fn load_continuation() -> Result<Option<SessionContinuation>> {
);
}
info!("Loaded session continuation from {:?}", latest_path);
debug!("Loaded session continuation from {:?}", latest_path);
Ok(Some(continuation))
}
@@ -131,7 +131,7 @@ pub fn clear_continuation() -> Result<()> {
debug!("Removed session file: {:?}", path);
}
}
info!("Cleared session continuation artifacts");
debug!("Cleared session continuation artifacts");
}
Ok(())