From d5d23e2cc2233f5b2717c82f9de4296749a43e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Mon, 19 Oct 2026 11:37:41 +0200 Subject: [PATCH] No color output by default flake-pilot no longer prints color by default. This change affects the messages as well as any progress information. Applied the change on the documentation side as well. This Fixes bsc#1285040 --- bubblewrap-pilot/src/main.rs | 2 +- doc/user_guide/troubleshooting.rst | 11 +++++++---- firecracker-pilot/guestvm-tools/sci/src/main.rs | 2 +- firecracker-pilot/src/firecracker.rs | 8 ++++---- firecracker-pilot/src/main.rs | 2 +- flake-ctl/src/fetch.rs | 4 ++-- flake-ctl/src/main.rs | 2 +- flake-pilot-helper/src/main.rs | 4 ++-- podman-pilot/src/main.rs | 2 +- podman-pilot/src/podman.rs | 8 ++++---- 10 files changed, 24 insertions(+), 21 deletions(-) diff --git a/bubblewrap-pilot/src/main.rs b/bubblewrap-pilot/src/main.rs index fa7822cd..eb3710b5 100644 --- a/bubblewrap-pilot/src/main.rs +++ b/bubblewrap-pilot/src/main.rs @@ -72,7 +72,7 @@ fn run() -> Result { fn setup_logger() { let env = Env::default() .filter_or("FLAKE_LOG_LEVEL", "debug") - .write_style_or("FLAKE_LOG_STYLE", "always"); + .write_style_or("FLAKE_LOG_STYLE", "never"); env_logger::init_from_env(env); } diff --git a/doc/user_guide/troubleshooting.rst b/doc/user_guide/troubleshooting.rst index 72b4556e..fb6c2b57 100644 --- a/doc/user_guide/troubleshooting.rst +++ b/doc/user_guide/troubleshooting.rst @@ -28,15 +28,18 @@ call also shows the complete list of mounts the application is given, which is usually what a missing file inside the sandbox comes down to. -The styling of the log output is controlled by the following -environment variable: +The log output is written without color by default. Colors are +enabled with the following environment variable: .. code-block:: bash FLAKE_LOG_STYLE=always myapp -Accepted values are ``always`` (default), ``never`` and ``auto``. -An unrecognized value falls back to ``auto``. +Accepted values are ``never`` (default), ``always`` and ``auto``. +An unrecognized value falls back to ``auto``. The variable applies +to the pilots and to flake-ctl. flake-pilot-helper does not see the +environment of its caller and always writes its messages without +color. Known Issues ============ diff --git a/firecracker-pilot/guestvm-tools/sci/src/main.rs b/firecracker-pilot/guestvm-tools/sci/src/main.rs index b6c55795..f8d55220 100644 --- a/firecracker-pilot/guestvm-tools/sci/src/main.rs +++ b/firecracker-pilot/guestvm-tools/sci/src/main.rs @@ -1878,7 +1878,7 @@ fn setup_logger() { !*/ let env = Env::default() .filter_or("FLAKE_LOG_LEVEL", "trace") - .write_style_or("FLAKE_LOG_STYLE", "always"); + .write_style_or("FLAKE_LOG_STYLE", "never"); env_logger::init_from_env(env); } diff --git a/firecracker-pilot/src/firecracker.rs b/firecracker-pilot/src/firecracker.rs index 3c77a603..bae1800a 100644 --- a/firecracker-pilot/src/firecracker.rs +++ b/firecracker-pilot/src/firecracker.rs @@ -34,7 +34,7 @@ use flakes::network::{ read_network_config, get_jump_rules, get_masquerade_rule, FirewallRule, NetworkConfig }; -use spinoff::{Spinner, spinners, Color}; +use spinoff::{Spinner, spinners}; use ubyte::ByteUnit; use std::path::Path; use std::process::{Stdio, id}; @@ -252,7 +252,7 @@ pub fn create(program_name: &String) -> Result<(String, String), FlakeError> { spinner = Some( Spinner::new_with_stream( spinners::Line, "Launching flake...", - Color::Yellow, spinoff::Streams::Stderr + None, spinoff::Streams::Stderr ) ); } @@ -260,13 +260,13 @@ pub fn create(program_name: &String) -> Result<(String, String), FlakeError> { match run_creation(&vm_id_file_path, program_name, engine_section) { Ok(result) => { if let Some(spinner) = spinner { - spinner.success("Launching flake"); + spinner.stop_and_persist("✓", "Launching flake"); } Ok(result) }, Err(error) => { if let Some(spinner) = spinner { - spinner.fail("Flake launch has failed"); + spinner.stop_and_persist("✗", "Flake launch has failed"); } Err(error) }, diff --git a/firecracker-pilot/src/main.rs b/firecracker-pilot/src/main.rs index 1a9594c0..f2d0c55d 100644 --- a/firecracker-pilot/src/main.rs +++ b/firecracker-pilot/src/main.rs @@ -69,7 +69,7 @@ fn run() -> Result<(), FlakeError> { fn setup_logger() { let env = Env::default() .filter_or("FLAKE_LOG_LEVEL", "debug") - .write_style_or("FLAKE_LOG_STYLE", "always"); + .write_style_or("FLAKE_LOG_STYLE", "never"); env_logger::init_from_env(env); } diff --git a/flake-ctl/src/fetch.rs b/flake-ctl/src/fetch.rs index 7e1908cc..f000492c 100644 --- a/flake-ctl/src/fetch.rs +++ b/flake-ctl/src/fetch.rs @@ -43,9 +43,9 @@ pub async fn fetch_file( &format!( "{}\n{} [{}] [{}] {}/{} ({}, {})", "{msg}", - "{spinner:.green}", + "{spinner}", "{elapsed_precise}", - "{wide_bar:.cyan/blue}", + "{wide_bar}", "{bytes}", "{total_bytes}", "{bytes_per_sec}", diff --git a/flake-ctl/src/main.rs b/flake-ctl/src/main.rs index 99c3b32d..f61a556c 100644 --- a/flake-ctl/src/main.rs +++ b/flake-ctl/src/main.rs @@ -515,7 +515,7 @@ fn init_flakes_dir(usermode: bool) -> Result<(), Box> { fn setup_logger() { let env = Env::default() .filter_or("FLAKE_LOG_LEVEL", "info") - .write_style_or("FLAKE_LOG_STYLE", "always"); + .write_style_or("FLAKE_LOG_STYLE", "never"); env_logger::init_from_env(env); } diff --git a/flake-pilot-helper/src/main.rs b/flake-pilot-helper/src/main.rs index 477f7260..f6c21bf2 100644 --- a/flake-pilot-helper/src/main.rs +++ b/flake-pilot-helper/src/main.rs @@ -139,10 +139,10 @@ fn setup_logger(debug: bool) { The log messages are only shown in debug mode, see PILOT_DEBUG. Errors are always shown, they tell the caller why a command - was refused or failed + was refused or failed. The messages are written without color !*/ Builder::new() .filter_level(if debug { LevelFilter::Debug } else { LevelFilter::Error }) - .write_style(WriteStyle::Always) + .write_style(WriteStyle::Never) .init(); } diff --git a/podman-pilot/src/main.rs b/podman-pilot/src/main.rs index 830cb1c9..323e5cb8 100644 --- a/podman-pilot/src/main.rs +++ b/podman-pilot/src/main.rs @@ -108,7 +108,7 @@ fn run_through_helper() -> ExitCode { fn setup_logger() { let env = Env::default() .filter_or("FLAKE_LOG_LEVEL", "debug") - .write_style_or("FLAKE_LOG_STYLE", "always"); + .write_style_or("FLAKE_LOG_STYLE", "never"); env_logger::init_from_env(env); } diff --git a/podman-pilot/src/podman.rs b/podman-pilot/src/podman.rs index 4c4c1952..00df88a9 100644 --- a/podman-pilot/src/podman.rs +++ b/podman-pilot/src/podman.rs @@ -49,7 +49,7 @@ use std::os::unix::process::CommandExt; use std::io::Seek; use std::io::SeekFrom; -use spinoff::{Spinner, spinners, Color}; +use spinoff::{Spinner, spinners}; use tempfile::tempfile; use tempfile::NamedTempFile; use regex::Regex; @@ -339,7 +339,7 @@ pub fn create( spinner = Some( Spinner::new_with_stream( spinners::Line, "Launching flake...", - Color::Yellow, spinoff::Streams::Stderr + None, spinoff::Streams::Stderr ) ); } @@ -354,13 +354,13 @@ pub fn create( ) { Ok(cid) => { if let Some(spinner) = spinner { - spinner.success("Launching flake"); + spinner.stop_and_persist("✓", "Launching flake"); } Ok((cid, container_cid_file)) }, Err(err) => { if let Some(spinner) = spinner { - spinner.fail("Flake launch has failed"); + spinner.stop_and_persist("✗", "Flake launch has failed"); } Err(err) },