Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lighthouse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use lighthouse_version::VERSION;
use logging::{build_workspace_filter, crit, MetricsLayer};
use malloc_utils::configure_memory_allocator;
use std::backtrace::Backtrace;
use std::io::IsTerminal;
use std::path::PathBuf;
use std::process::exit;
use std::sync::LazyLock;
Expand Down Expand Up @@ -521,10 +522,15 @@ fn run<E: EthSpec>(

let log_format = matches.get_one::<String>("log-format");

let log_color = matches
.get_one::<bool>("log-color")
.copied()
.unwrap_or(true);
let log_color = if std::io::stdin().is_terminal() {
matches
.get_one::<bool>("log-color")
.copied()
.unwrap_or(true)
} else {
// Disable color when in non-interactive mode.
false
};

let logfile_color = matches.get_flag("logfile-color");

Expand Down
Loading