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:
@@ -3,7 +3,7 @@ use crate::process::ProcessController;
|
||||
use axum::{extract::State, http::StatusCode, Json};
|
||||
use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use tracing::{error, info};
|
||||
use tracing::{debug, error};
|
||||
|
||||
pub type ControllerState = Arc<Mutex<ProcessController>>;
|
||||
|
||||
@@ -22,7 +22,7 @@ pub async fn kill_instance(
|
||||
|
||||
match controller.kill_process(pid) {
|
||||
Ok(_) => {
|
||||
info!("Successfully killed process {}", pid);
|
||||
debug!("Successfully killed process {}", pid);
|
||||
Ok(Json(serde_json::json!({
|
||||
"status": "terminating"
|
||||
})))
|
||||
@@ -38,7 +38,7 @@ pub async fn restart_instance(
|
||||
State(controller): State<ControllerState>,
|
||||
axum::extract::Path(id): axum::extract::Path<String>,
|
||||
) -> Result<Json<LaunchResponse>, StatusCode> {
|
||||
info!("Restarting instance: {}", id);
|
||||
debug!("Restarting instance: {}", id);
|
||||
|
||||
// Extract PID from instance ID (format: pid_timestamp)
|
||||
let pid: u32 = id
|
||||
@@ -81,7 +81,7 @@ pub async fn launch_instance(
|
||||
State(controller): State<ControllerState>,
|
||||
Json(request): Json<LaunchRequest>,
|
||||
) -> Result<Json<LaunchResponse>, (StatusCode, Json<serde_json::Value>)> {
|
||||
info!("Launching new g3 instance: {:?}", request);
|
||||
debug!("Launching new g3 instance: {:?}", request);
|
||||
|
||||
// Validate binary path if provided
|
||||
if let Some(ref binary_path) = request.g3_binary_path {
|
||||
@@ -149,7 +149,7 @@ pub async fn launch_instance(
|
||||
) {
|
||||
Ok(pid) => {
|
||||
let id = format!("{}_{}", pid, chrono::Utc::now().timestamp());
|
||||
info!("Successfully launched g3 instance with PID {}", pid);
|
||||
debug!("Successfully launched g3 instance with PID {}", pid);
|
||||
Ok(Json(LaunchResponse {
|
||||
id,
|
||||
status: "starting".to_string(),
|
||||
|
||||
@@ -3,7 +3,7 @@ use axum::{http::StatusCode, Json};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
use std::path::PathBuf;
|
||||
use tracing::{error, info};
|
||||
use tracing::{debug, error};
|
||||
|
||||
pub async fn get_state() -> Result<Json<ConsoleState>, StatusCode> {
|
||||
let state = ConsoleState::load();
|
||||
@@ -15,7 +15,7 @@ pub async fn save_state(
|
||||
) -> Result<Json<serde_json::Value>, StatusCode> {
|
||||
match state.save() {
|
||||
Ok(_) => {
|
||||
info!("Console state saved successfully");
|
||||
debug!("Console state saved successfully");
|
||||
Ok(Json(serde_json::json!({
|
||||
"status": "saved"
|
||||
})))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use tracing::info;
|
||||
use tracing::debug;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ConsoleState {
|
||||
@@ -42,7 +42,7 @@ impl ConsoleState {
|
||||
|
||||
pub fn save(&self) -> anyhow::Result<()> {
|
||||
let config_path = Self::config_path();
|
||||
info!("Saving console state to: {:?}", config_path);
|
||||
debug!("Saving console state to: {:?}", config_path);
|
||||
|
||||
// Create parent directory if it doesn't exist
|
||||
if let Some(parent) = config_path.parent() {
|
||||
@@ -51,7 +51,7 @@ impl ConsoleState {
|
||||
|
||||
let content = serde_json::to_string_pretty(self)?;
|
||||
fs::write(&config_path, content)?;
|
||||
info!("Console state saved successfully to: {:?}", config_path);
|
||||
debug!("Console state saved successfully to: {:?}", config_path);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ use std::sync::Arc;
|
||||
use tokio::sync::Mutex;
|
||||
use tower_http::cors::CorsLayer;
|
||||
use tower_http::services::ServeDir;
|
||||
use tracing::{info, Level};
|
||||
use tracing::Level;
|
||||
use tracing_subscriber;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -84,12 +84,12 @@ async fn main() -> anyhow::Result<()> {
|
||||
.layer(CorsLayer::permissive());
|
||||
|
||||
let addr = format!("{}:{}", args.host, args.port);
|
||||
info!("Starting g3-console on http://{}", addr);
|
||||
debug!("Starting g3-console on http://{}", addr);
|
||||
|
||||
// Auto-open browser if requested
|
||||
if args.open {
|
||||
let url = format!("http://{}", addr);
|
||||
info!("Opening browser to {}", url);
|
||||
debug!("Opening browser to {}", url);
|
||||
let _ = open::that(&url);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use std::path::PathBuf;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::sync::Mutex;
|
||||
use sysinfo::{Pid, Process, Signal, System};
|
||||
use tracing::{debug, info};
|
||||
use tracing::debug;
|
||||
|
||||
pub struct ProcessController {
|
||||
system: System,
|
||||
@@ -26,7 +26,7 @@ impl ProcessController {
|
||||
self.system.refresh_processes();
|
||||
|
||||
if let Some(process) = self.system.process(sysinfo_pid) {
|
||||
info!("Killing process {} ({})", pid, process.name());
|
||||
debug!("Killing process {} ({})", pid, process.name());
|
||||
|
||||
// Try SIGTERM first
|
||||
if process.kill_with(Signal::Term).is_some() {
|
||||
@@ -107,7 +107,7 @@ impl ProcessController {
|
||||
});
|
||||
}
|
||||
|
||||
info!("Launching g3: {:?}", cmd);
|
||||
debug!("Launching g3: {:?}", cmd);
|
||||
|
||||
// Spawn and wait for the intermediate process to exit
|
||||
let mut child = cmd.spawn().context("Failed to spawn g3 process")?;
|
||||
@@ -120,7 +120,7 @@ impl ProcessController {
|
||||
|
||||
// The actual g3 process is now running as orphan
|
||||
// We need to scan for it by matching workspace and recent start time
|
||||
info!(
|
||||
debug!(
|
||||
"Scanning for newly launched g3 process in workspace: {}",
|
||||
workspace
|
||||
);
|
||||
@@ -171,7 +171,7 @@ impl ProcessController {
|
||||
found
|
||||
} else {
|
||||
// If we couldn't find it, try one more refresh after a longer delay
|
||||
info!("Process not found on first scan, trying again...");
|
||||
debug!("Process not found on first scan, trying again...");
|
||||
std::thread::sleep(std::time::Duration::from_millis(2000));
|
||||
self.system.refresh_processes();
|
||||
|
||||
@@ -204,7 +204,7 @@ impl ProcessController {
|
||||
retry_found.unwrap_or(intermediate_pid)
|
||||
};
|
||||
|
||||
info!("Launched g3 process with PID {}", pid);
|
||||
debug!("Launched g3 process with PID {}", pid);
|
||||
|
||||
// Store launch params for restart
|
||||
let params = LaunchParams {
|
||||
|
||||
@@ -3,7 +3,7 @@ use anyhow::Result;
|
||||
use chrono::{DateTime, Utc};
|
||||
use std::path::PathBuf;
|
||||
use sysinfo::{Pid, Process, System};
|
||||
use tracing::{debug, info, warn};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
pub struct ProcessDetector {
|
||||
system: System,
|
||||
@@ -17,7 +17,7 @@ impl ProcessDetector {
|
||||
}
|
||||
|
||||
pub fn detect_instances(&mut self) -> Result<Vec<Instance>> {
|
||||
info!("Scanning for g3 processes...");
|
||||
debug!("Scanning for g3 processes...");
|
||||
// Refresh all processes to ensure we catch newly started ones
|
||||
// Using refresh_all() instead of just refresh_processes() to ensure
|
||||
// we get complete information about new processes
|
||||
@@ -37,7 +37,7 @@ impl ProcessDetector {
|
||||
}
|
||||
}
|
||||
|
||||
info!("Detected {} g3 instances", instances.len());
|
||||
debug!("Detected {} g3 instances", instances.len());
|
||||
Ok(instances)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user